Apk signer entry does not contain a key

喜夏-厌秋 提交于 2019-12-10 22:37:17

问题


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

but it's giving me an error saying that

Failed to load signer "signer #1": D:\Android\SDK\keystores\release.keystore entry "uploadcertificate" does not contain a key

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?

来源:https://stackoverflow.com/questions/50438908/apk-signer-entry-does-not-contain-a-key

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