8

I am integrated LinkedIn successfully using newly released Android Mobile SDK and all done well using Android Studio, but when I generating signed apk is showing the below mentioned error. I heard that we have to use debug.keystore file otherwise this error LinkedIn sdk will return same error. I have done that too, but the scenario was while we are generating signed apk in Android Studio it's giving .jks file not .keystore file. Please tell me the step how to generate .keystore file and how to configure this in build.gradle.

Error:

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

My gradle file look like below, and I pasted the .jks file inside app direction, but still while installing signed apk its not running giving the error as I mentioned, but it working fine when installing the app in debugging mode.

build.gradle:

allprojects {
repositories {
mavenCentral()
}
}

apply plugin: 'com.android.application'

android {
 compileSdkVersion 22
 buildToolsVersion "21.1.2"

 defaultConfig {
 applicationId "com.myapp.hello"
 minSdkVersion 14
 targetSdkVersion 22
 versionCode 1
 versionName "1.0"
 }

  signingConfigs {
     sdkTest {
     storeFile file("secureln.jks")
     storePassword "password"
     keyAlias "secureln"
     keyPassword "password"
     }

  release {
    storeFile file("secureln.jks")
     storePassword "password"
    keyAlias "secureln"
   keyPassword "password"
  }
     }
     buildTypes {
     sdkTest {
       debuggable false
       signingConfig signingConfigs.sdkTest
        }
      release {
      debuggable false
       signingConfig signingConfigs.release
     }
       }
       }

       dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
        compile project(':linkedin-sdk')
             }

              configurations {
                 }

               dependencies {
           compile 'com.android.support:appcompat-v7:22.0.0'
            compile 'com.google.code.gson:gson:2.3.1'
               }

I need to any one help me please.

Anoop M Maddasseri
  • 10,213
  • 3
  • 52
  • 73
Stella
  • 1,817
  • 6
  • 30
  • 55

3 Answers3

7

Since you have this issue only with signed APK, seems you have configured an incorrect release key hash value.

Try to check that the release key hash value of the keystore you used to sign the APK is correctly listed in the "Android Package Names and Hashes" field of your LinkedIn application's configuration as described in the documentation:

Generating a release key hash value

To generate a release key hash value, use the following command:

keytool -exportcert -keystore YOUR_RELEASE_KEY_PATH -alias YOUR_RELEASE_KEY_ALIAS | openssl sha1 -binary | openssl base64


Configure the values

In the "Android Package Names and Hashes" field of your LinkedIn application's configuration, provide one or more values in the following comma-separated format:

Android.Package.Name,Key-Hash-Value
Mattia Maestrini
  • 32,270
  • 15
  • 87
  • 94
  • Just saved me.awesome stuff.thanks a lot.all you said is at the best.eureka i completed LinkedIn integration finally :) – Stella Apr 22 '15 at 06:44
  • @Mattia, have you done any sample application for LinkedIn sign-in using LinkedIn sdk in eclipse? – ManishSB Apr 22 '15 at 13:50
  • @Mattia,now happening vice versa.signed apk is working but debugging mode isn't.? – Stella Apr 23 '15 at 04:36
  • @Stella Have you provided either debug and release key hash value as you can see in this [image](https://snap.licdn.com/microsites/content/dam/developer/global/en_US/site/img/package_hash_values.png)? – Mattia Maestrini Apr 23 '15 at 06:21
  • @ManishSB Sorry but i haven't used LinkedIn SDK with Eclipse – Mattia Maestrini Apr 23 '15 at 06:24
  • yes #Mattia i done as per mentioned in the docs.and signed apk working fine now not in debugging mode.perhaps some security issue? will work only while generate signed apk? anything like that? – Stella Apr 23 '15 at 11:36
  • I think there is something wrong in the key hash value for the debug certificate. Please note that the default password of debug certificate is `android`. Try to recalculate the hash and add to your LinkedIn application's configuration. – Mattia Maestrini Apr 23 '15 at 12:37
  • can u give please post an example build.gradle file with explanations? – Stella Apr 23 '15 at 13:11
  • There are two separate box for each value, how can I give comma separated? – Pratik Butani Nov 04 '17 at 05:44
6

In SDK there is "debug.keystore" file in sample app and events app Password of that keystore file is : android

Sign that sample or event app with that keystore file. It will solve your problem

Krishna Patel
  • 157
  • 2
  • 6
3

For debug apk I realised that I was using wrong password, for default debug keystore password is android , command given in docs will generate hash key for any password, so please use correct password to save time

Manjeet Singh
  • 4,382
  • 4
  • 26
  • 39