Unable to export signed APK in Android Studio

我的梦境 提交于 2019-12-05 12:19:32

Got the answer after 20 hours of tireless searching. Apparently there is some issue with the character '&' in passwords as mentioned here https://code.google.com/p/android/issues/detail?id=36350 Although in my case, the character was '@'.

For anyone who gets stuck, here is what I did (and what should work for them too)

  1. I used the keytool -keypasswd -alias <key_name> -keystore mykeystorek.jks command to change password for my key alias password.
  2. Since I suspected my original file had some issues, I thought it best to export the keys to another file. I did that using keytool -importkeystore -srckeystore my.keystore.jks -destkeystore new.keystore -deststoretype pkcs12 followed by keytool -importkeystore -srckeystore new.keystore -srcstoretype pkcs12 -destkeystore final.keystore -deststoretype jks.

What this does is, export the original keystore values in PKCS12 format, and then back to Java Keystore format in the filename final.keystore. In all these commands, the prompt asked for new destination password, which I carefully chose, avoiding @ and &.

And it works now! As indicated in the link shared above,this seems to be due to some update pushed in SDK Tools 20. I know it's bad. The other app owners seem pretty pissed at Google too. :(

I could not get Android Studio to sign my APK no matter what I tried.

I was getting this error even when I attempted to create a new keystore and key and used that to sign it during Android Studio build release.

In the end, I got it to work by using Keystore explorer to re-set the password to 'changeit' for both the keystore as well as the signing key that I was using.

This is both disconcerting and confusing to me. There is no way that this should happen, but it does.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!