問題描述
INSTAL_PARSE_FAILED_NO_CERTIFICATES ‑ 試圖在 robotsium 上測試不是我的 .apk 文件 (INSTAL_PARSE_FAILED_NO_CERTIFICATES ‑ trying to test not my .apk file on robotium)
it's for robotium test‑login system
First i've un‑signed a signed application downloaded java program from http://www.troido.de/re‑sign.jar double clicked on it to open it and droped apk file on it ‑ so i have .apk without META‑¬INF folder.
Next i've tried to sign it following this instructions: Open a terminal window / Command prompt and enter (the jarsigner tool is located in the bin folder of your installed java sdk jarsigner ‑keystore ~/.android/debug.keystore ‑storepass android ‑keypass android APPNAME.apk androiddebugkey
I found keystore location by eclipse >> window ‑> preferences ‑> Android ‑> Build
i've tried to install app with debug mode :
Microsoft Windows [Wersja 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.
C:\Users\Marta\Desktop>jarsigner ‑keystore C:\Users\Marta\.android\debug.keystor
e ‑storepass android ‑keypass android Facebook_debug.apk androiddebugkey
C:\Users\Marta\Desktop>cd C:\Users\Marta\Desktop\Android_tests\sdk\platform‑tools
C:\Users\Marta\Desktop\Android_tests\sdk\platform‑tools>adb install C:\Users\Mar
ta\Desktop\Android_tests\sdk\platform‑tools\Facebook_debug.apk
78 KB/s (16093644 bytes in 200.626s)
pkg: /data/local/tmp/Facebook_debug.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]
Maybe You know why it's not working
?
I will be grateful for your help
參考解法
方法 1:
Try this. it works for me
To manually re‑sing APK follow the below steps:
- Un‑zip the APK file
- Delete the META‑¬INF folder
- Re‑zip the APK file It will zip file as "applicationName.apk.zip”, rename it to: "applicationName.apk"
In Dos prompt/Terminal write following commands
jarsigner ‑verbose ‑sigalg MD5withRSA ‑digestalg SHA1 –keystore C:\Users\Rcoutinho.android\debug.keystore ‑storepass android ‑keypass android applicationName.apk androiddebugkey
zipalign 4 applicationName.apk TempApplicationName.apk
Then rename TempApplicationName.apk to applicationName.apk if you want.
方法 2:
I did ^^it ‑ step by step but now it's still not working ‑ new information:
C:\Users\Marta\Desktop\Android_tests\sdk\platform‑tools>adb install C:\Users\Marta\Desktop\Android_tests\sdk\platform‑tools\FacebookTest.apk file C:\Users\Marta\Desktop\Android_tests\sdk\platform‑tools\FacebookTest.apk'does not contain AndroidManifest.xml rm failed for /data/local/tmp/FacebookTest.apk, No such file or directory
maybe You know what i did wrong?
(fail by fail..ehh)
方法 3:
Step 1: unzip the apk file. When u do this you well b able to see the folder and also AndroidManifest.xml file
2: Delete the META‑¬INF folder
3: Re‑zip the entire remaining content (all folder and AndroidManifest.xml)
Note: re‑zip the content inside the apk. Do not go back and re‑zip the apk (parent folder)
Then follow the remaining steps
(by onna14、Rudolf Coutinho、onna14、Rudolf Coutinho)