Command line jarsigner sign and resolve certificate chain not found error
question:
I'm learning Ionic3 recently, and then I made a page, and I want to test it on my Android phone. As a result, an error is reported when the jarsigner
signature .
Error picture:
Solution
Explanation of the command line
jarsigner -verbose -keystore [your private key storage path] -signedjar [signed file storage path] [unsigned file path] [your certificate alias]
Please see the last parameter: [您的证书的别名]
, not our keystore 文件名
is because this problem
The correct command line to use is
jarsigner -verbose -keystore my-release-key.keystore -signedjar complete.apk app-release-unsigned.apk alias_name
How to check file aliases
You need to keytool
see keystore
the command used when using the make file:
keytool -genkey -v -keystore [keystore的文件名] -alias [别名] -keyalg RSA -keysize 2048 -validity 10000
Parameter Description:
-keyalg RSA --产生键的加密算法
-validity 40000 --有效期限4000天
The command I use is:
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
So my alias is: alias_name
.
correctly displayed figure
Note
- When using the
jarsigner
signature , pay special attention to whether the last parameter is别名
or not文件名
. - Attach the picture I show on the simulator