【问题标题】:Why Android Developer Bundle Tool Does not Recognize the Key In my Keystore?为什么 Android Developer Bundle Tool 无法识别我的密钥库中的密钥?
【发布时间】:2021-09-08 08:31:41
【问题描述】:

我的密钥库文件中有一个条目。我可以用命令看到内容:

$ keytool -list -keystore app-signing-key.keystore
Enter keystore password:  
Keystore type: jks
Keystore provider: SUN

Your keystore contains 1 entry

appsigning, Sep 8, 2021, trustedCertEntry, 
Certificate fingerprint (SHA1): D:....<the sha1 here>...:D

我正在尝试使用此条目通过 java bundle 工具和以下命令创建 apk,但我收到一个错误,即找不到该条目。

$ java -jar $HOME/bin/bundletool-all-1.8.0.jar build-apks --bundle ./app-release.aab --output app.apks --connected-device --ks ./app-signing-key.keystore --ks-key-alias=appsigning
Enter keystore password: 
[BT:1.8.0] Error: No key found with alias 'appsigning' in keystore.
com.android.tools.build.bundletool.model.exceptions.CommandExecutionException: No key found with alias 'appsigning' in keystore.
        at com.android.tools.build.bundletool.model.exceptions.InternalExceptionBuilder.build(InternalExceptionBuilder.java:57)
        at com.android.tools.build.bundletool.model.SignerConfig.readSigningConfigFromLoadedKeyStore(SignerConfig.java:184)
        at com.android.tools.build.bundletool.model.SignerConfig.extractFromKeystore(SignerConfig.java:140)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.populateSigningConfigurationFromFlags(BuildApksCommand.java:1127)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:599)
        at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:565)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:77)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:49)

这很奇怪。

为什么 bundletool 看不到使用别名的条目?

【问题讨论】:

  • 如果您可以使用非敏感密钥库重现错误,我建议您在 bundletool GitHub 的问题跟踪器中提交错误。

标签: android android-app-signing bundletool


【解决方案1】:

您必须为您的密钥库提供别名 喜欢:

keytool -list -keystore app-signing-key.keystore -alias KEY_ALIAS_HERE

如果您没有指定任何KEY_ALIAS,那么它将默认别名为“appsigning”。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-07-17
    • 2015-09-13
    • 1970-01-01
    • 2016-10-28
    • 2011-09-03
    • 2022-01-14
    • 1970-01-01
    相关资源
    最近更新 更多