Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updating apk SHA1 differs even after using same keystore

I have uploaded my app to Goggle Play few months back after signing it with a release keystore, I have stored that Keystore for future updation.

Now I have updated the apk with some changes, while trying to upload the new apk signed with same keystore along with same alias and password, the apk is not allowed to upload to Goggle Play. Playstore shows me following error : enter image description here



The only change is, earlier the appication was developed and build using eclipse and now in android studio
Can this be the reason for showing the above error???

like image 711
Jitu Avatar asked Aug 28 '15 07:08

Jitu


People also ask

Can I use same keystore for multiple apps?

A keystore is just a means to securely store the public/private key pair which is used to sign your Android apks. So yes, you can use the same keystore to sign multiple apks, without a problem. You can also use the same alias (each alias is a certificate) to sign multiple apks, and it will work.


1 Answers

From the error message I would say you have mixed up the keystores, or android studio is just using the wrong one to do the release build. The best way to be completely sure is to clearly setup your build.gradle, and build it yourself on the command line using

 ./gradlew clean assembleRelease

What is probably happening is that Android Studio is using your debug keystore (ie. the default) to sign the release build because it can't find the original keystore you used in eclipse, or you have the wrong password somewhere...

Have a look at this configuration, note the location of the keystores, the naming convention and how it corresponds to the build.gradle. Note the signingconfigs and how they are setup for the release build. To build from the command line, simply cd into the directory with your "gradlew" file, and run

./gradlew clean assembleRelease

to build the release apk, or

./gradlew clean assembleDebug

to build the debug apk. If it fails, try

./gradlew clean assembleRelease --stacktrace

Screenshot of build.gradle and filesystem setup

But please remember not to put your keys in your source control! That means editing your .gitignore file.

There is a stack of information on how to do this here: http://developer.android.com/tools/publishing/app-signing.html

like image 80
shredder Avatar answered Oct 12 '22 05:10

shredder