2015-04-23 83 views
2

我正在尝试使用处理功能来创建Android apk。签名安卓APK下载:INSTALL_PARSE_FAILED_NO_CERTIFICATES

这是我做了什么(在此基础上:http://www.akeric.com/blog/?p=1352):

keytool -genkey -v -keystore myapp-release-key.keystore -alias myname -keyalg RSA -keysize 2048 -validity 10000 

ant release 

jarsigner -verbose -keystore myapp-release-key.keystore <PATH>/android/bin/<APPNAME>-release-unsigned.apk myname 

jarsigner -verify <PATH>/android/bin/<APPNAME>-release-unsigned.apk 

zipalign -v 4 bin/<APPNAME>-release-unsigned.apk bin/<APPNAME>-release.apk 

adb install bin/<APPNAME>-release.apk 

但我得到一个错误:

INSTALL_PARSE_FAILED_NO_CERTIFICATES 

的的jarsigner校验终止:

s = signature was verified 
m = entry is listed in manifest 
k = at least one certificate was found in keystore 
i = at least one certificate was found in identity scope 

jar verified. 

Warning: 
    This jar contains entries whose certificate chain is not validated. 
    This jar contains signatures that does not include a timestamp. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2042-09-08) or after any future revocation date. 

任何关于什么是错的想法?与这些警告有什么关系?

+0

您是否使用'./gradlew build'重建了您的应用程序? – Dimitri

回答

2

确保向您的jarsigner命令添加以下2个选项:-sigalg SHA1withRSA -digestalg SHA1,即使您在生成密钥时已经指定了类似内容。像这样:

让我AGES认识到这些不是可选的...... Doc在那个上绝对不清楚。

希望有所帮助。祝你好运。