简体   繁体   中英

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

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.

keytool -list -v -keystore app_signing.keystore获取有关证书的信息并检查其是否正常

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM