APK签名人条目不包含密钥 [英] Apk signer entry does not contain a key
问题描述
我正在尝试使用此代码使用APK签名者手动签名APK
I am trying to sign an APK manually using APK signer using this code
apksigner sign --ks D:\Android\SDK\keystores\release.keystore --ks-key-alias uploadcertificate --out app-release.apk app.apk
但是这给我一个错误
Failed to load signer "signer #1": D:\Android\SDK\keystores\release.keystore entry "uploadcertificate" does not contain a key
但是,当我使用keytool在我的密钥库中列出别名时,我能够看到别名uploadcertificate.
however, when I use keytool to list the aliases in my keystore, I am able to see the alias uploadcertificate.
keytool -v -list -keystore D:\Android\SDK\Keystores\release.keystore
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: uploadcertificate
Creation date: May 21, 2018
Entry type: trustedCertEntry
Owner: C=US, O=Android, CN=Android Debug
Issuer: C=US, O=Android, CN=Android Debug
Serial number: 1
Valid from: Mon Feb 13 23:47:57 IST 2017 until: Wed Feb 06 23:47:57 IST 2047
Certificate fingerprints:
MD5: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
SHA1: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
SHA256: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**
Signature algorithm name: SHA1withRSA
Subject Public Key Algorithm: 1024-bit RSA key
Version: 1
任何想法为什么会发生这种情况?
Any Idea Why this might be happening?
推荐答案
生成密钥库时,请不要使用任何非法字符,尤其是密码.我的密码中有#".带有字母和数字的Generatin新密钥允许我对应用程序进行签名.
When generating your Keystore, do not use any illegal characters, especially in your password. I had "#" in my password. Generatin new key with just letters and numbers allowed me to sign the app.
可在此处找到更多说明/答案: Visual Studio的AndroidApkSigner在密钥库中找不到密钥
More explanation/answer found here: Visual Studio's AndroidApkSigner does not find key in keystore
这篇关于APK签名人条目不包含密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!