Android apk upload fails with error 'The apk must be signed with the same certificates as the previous one'

StackOverflow https://stackoverflow.com/questions/14231700

Question

I know this question has been asked before, but I am pretty sure I am using the same keystore. I stored the keystore I used to sign the first version of my app and then used the same to create the second release.

jarsigner -verbose -digestalg SHA1 -sigalg MD5withRSA -keystore app_signing.keystore target/HNewsDroid-2.0.apk release
zipalign -v 4 target/HNewsDroid-2.0.apk target/HNewsDroid-2.0-release.apk  I 

Even though I have no access to my previous Linux installation from where I generated the app_signing.keystore using keytool, I believe only the keystore file needs to be the same while signing the jar (even though my private ssh key has changed on my new Linux installation).

In case it helps, I am using maven android plugin to generate the jars/apks.

Could someone point out what I am doing wrong?

EDIT:

I have no idea why the certificate I signed my app with is not working. I changed my package name and uploaded the application as a new application, finally.

Was it helpful?

Solution 3

It turned out that I had incorrectly generated the private key with keytool. It had two names and that was causing the problem. I regenerated the certificate with only one name and the problem went away.

OTHER TIPS

keytool -list -v -keystore app_signing.keystore - get the info about the certificate and check if its ok

You are correct in the assumption that only the keystore needs to be the same - the private SSH key on your machine doesn't matter.

You can sign the app on as many different machines as you would like (assuming you are using the same keystore).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top