2015-04-23 110 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在那個上絕對不清楚。

希望有所幫助。祝你好運。