androidlinkedin-apimalformed

Malformed hashkey in Linked android integration


I am getting this error in authentication`

{
"errorCode": "INVALID_REQUEST",
"errorMessage": "either bundle id or package name \/ hash are invalid, unknown, malformed"
}

`

my gradle (module app) file is here

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "com.fleksworks.nativeapplication"
        minSdkVersion 22
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
        mavenCentral()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })



    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile project(path: ':linkedin-sdk')
    compile 'com.wdullaer:materialdatetimepicker:3.0.0'

    compile 'com.google.android.gms:play-services-maps:10.0.1'
}

settings.gradle file is here

include ':app', ':linkedin-sdk'

i used both the hashkey generation process using app and using linux terminal. but they are giving me different hashkeys , the one i get using JAVA code, if i want to add that hashkey, then it cant be added, linked in says hashkey is malformed,on the other hand the one I get from console, it can be added, but if i add this, then I get the above mentioned error while authenticating. Please help me out.


Solution

  • Eventually, I got managed to solve my problem, what I did was used both keys, after that I did not incur any more problem