Android APK built from Android studio and console has different SHA fingerprints

When creating a signed APK release, I came across the following: if I create a signed apk from android studio (via BuildGenerate Signed APK... ) with a build.gradle file similar to this (only relevant parts):

 signingConfigs { release { storeFile file('/keystore/location/mykeystore.keystore') storePassword 'storepassword' keyAlias 'key' keyPassword 'keypassword' } } buildTypes { release { signingConfig signingConfigs.release } } 

Received fingerprint apk YY:YY .
However, if I build the APK from the console, as described here , using build.gradle like this:

 buildTypes { release { } } 

And sign it with the same keystore file, the final apk fingerprint will be XX:XX .

In addition, both SHA fingerprints are different from my SHA debug certificate fingerprint. What is the reason for this behavior?

I am using buildToolsVersion 23.0.0
android studio gradle version 1.3.0
android sdk tools version 24.3.4
version for Android version 1.3.1

+8
android android-studio android-gradle apk gradlew
source share
1 answer

Have you checked the contents of the keystore? The fingerprint must match one of the certificates. Perhaps you have several certificates in the keystore, maybe another one is used during signing from the console? You can verify certificates by running the following command:

keytool -v -list -keystore / path / to / keystore

enter the password for the keystore and you should get a list of aliases. I would also check the debug repository to make sure there are no other certificates there.

The only other possibility I can think of is a path issue that causes the use of another keystore.

+1
source share

All Articles