【问题标题】:"Cannot recover key" error when generating APK生成 APK 时出现“无法恢复密钥”错误
【发布时间】:2020-02-07 08:59:01
【问题描述】:

生成签名的 APK 时出现以下错误:

 Caused by: java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key key0 from store "/Users/zorgan/Desktop/keystore": Cannot recover key

 Caused by: java.security.UnrecoverableKeyException: Cannot recover key
        at sun.security.provider.KeyProtector.recover(KeyProtector.java:315)
        at sun.security.provider.JavaKeyStore.engineGetKey(JavaKeyStore.java:141)
        at sun.security.provider.JavaKeyStore$JKS.engineGetKey(JavaKeyStore.java:56)
        at java.security.KeyStoreSpi.engineGetEntry(KeyStoreSpi.java:473)
        at sun.security.provider.KeyStoreDelegator.engineGetEntry(KeyStoreDelegator.java:172)
        at sun.security.provider.JavaKeyStore$DualFormatJKS.engineGetEntry(JavaKeyStore.java:70)
        at java.security.KeyStore.getEntry(KeyStore.java:1521)
        at com.android.ide.common.signing.KeystoreHelper.getCertificateInfo(KeystoreHelper.java:191)
        ... 32 more

我已经检查了我的executionHistory.bin 文件并确认 Keystore 密码和 Key 密码都是正确的,并且都是相同的密码:

signingConfig.keyAliasÖkey0ösigningConfig.keyPasswordí**mypassword**úsigningConfig.storePasswordí**mypassword**òsigningConfig

可能是什么问题?

【问题讨论】:

    标签: android android-studio terminal apk


    【解决方案1】:

    与此处的许多答案相反,Keystore 密码Key password 必须不同:

    我的 Keystore 密码正确,但我必须为我的 Key 密码(别名密码)尝试不同的密码。最终它奏效了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-04-30
      相关资源
      最近更新 更多