在尝试使用IntelliJ的Android插件几个月后,我最近又回到了Android Studio。然后我尝试在Play商店中签署当前处于beta测试状态的应用的APK,但签名与之前版本的Dev Play Console上的签名不匹配。我仔细检查过,我确信我使用的密钥库(和密钥相同)与以前一样。
现在我有两种可能性:
•将IntelliJ迁移到Android时是否存在代码签名问题?
•我的密钥库密码错误。但是,为什么它会成功构建APK?
我可以排除这两个方向中的任何一个吗?
它在谷歌帮助中读到,如果密钥库丢失(情况并非如此,但可能是密码),则需要在Play商店中使用新的软件包名称重新创建一个全新的应用程序。
真的没有其他选择吗?
PS:我过去曾为apk签名下载了一些证书,但我不知道如何在Android studio中使用它们而不是jks文件。
编辑
我从商店得到的错误信息是:
You uploaded an APK that is not signed with the upload certificate.
You must use the same certificate. The upload certificate has fingerprint:
[ SHA1: XXX ]
and the certificate used to sign the APK you uploaded have
fingerprint:
[ SHA1: YYY ]
然而,当我运行以下内容时:
keytool -list -v -keystore "/Path/upload_keystore.jks"
-alias "upload_key" -storepass ***** -keypass ****
我知道SHA1实际上是XXX(而不是YYY)。所以应该是对的。另外,奇怪的是:无论我使用什么密码,我都得到相同的SHA1,这是正确的!
但我也收到以下消息:
Warning:
The JKS keystore uses a proprietary format. It is recommended to
migrate to PKCS12 which is an industry standard format using "keytool
-importkeystore -srckeystore /Path/upload_keystore.jks -
destkeystore /Path/upload_keystore.jks -deststoretype pkcs12".
这是奇怪的,因为它是由谷歌生成的。
好吧,我只是做了一个干净的构建,并再次签名,它工作。我想第一次签名尝试是错误的,但它被缓存并阻止其他签名尝试真正有效。