Failure [install_parse_failed_no_certificates] when attempting to install APK to the emulator
Asked Answered
T

4

51

I downloaded Myfiles.apk from the internet and I'm trying to install it to my Android emulator.

While installing Myfiles.apk file through the command prompt, I'm getting this error.

I tried following in command prompt

C:\android-sdk\tools> adb -s emulator-5554 install C:\Users\Me\Desktop\MyFiles.apk

How do I install this APK to the emulator correctly?

Tate answered 26/3, 2013 at 11:50 Comment(1)
Possible duplicate of What is INSTALL_PARSE_FAILED_NO_CERTIFICATES error?Configurationism
M
45

This site helped me a lot to properly sign the unsigned apk. But,for the last process i.e. for jarsigner,following command need to be used

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore    my_application.apk alias_name.

Further do look upon this unable to sign zipexception if you encounter with any zipexception error . So overall,use following procedure

  1. keytool -genkey -v -keystore debug.keystore -alias android -keyalg RSA -keysize 2048 -validity 20000
  2. jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore yourapkalign.apk alias_name
  3. zipalign -v 4 yourapk.apk yourapkalign.apk

Now,you can successfully install the apk file.

Mottle answered 2/1, 2014 at 7:14 Comment(5)
zipalign -v apkfile is not sufficient, you need to execute zipalign -v 4 apkfile you need to provide align size.Anisometric
Also, I have been told that you need to run zipalign last, or jarsigner breaks the alignment.Milks
I am trying to install app to my phone. I've executed all the above commands. (Though I think the second one should be ... -keystore debug.keystore .... But I am getting the following error: >Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl840513344.tmp/base.apk: META-INF/MYKEY.SF indicates /data/app/vmdl840513344.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature was found. Signature stripped?]Sears
2021 and also getting this same error as @Sears . Any solution?Hanzelin
For Android 11 (No signature found in package of version 2 or newer): zipalign first, then instead of jarsign: apksigner sign --ks ~/.android/debug.keystore --ks-key-alias someKey foo.apkExo
C
11

It means that the apk you downloaded hasn't been signed with any certificate, debug or otherwise.

You can sign it from the command line, as described here.

Chew answered 26/3, 2013 at 11:53 Comment(0)
U
1

You can use the androiddebugkey the sign the apk.

The keystore lives in ~/.android, named debug.keystore.

Run

keytool -list -keystore ~/.android/debug.keystore

To see the debug key, we can see its name is androiddebugkey

Run the following command to sign the apk.

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore yourapp-release.apk androiddebugkey
Ultrasonic answered 8/5, 2020 at 20:56 Comment(0)
L
1

Nowadays you should use apksigner and not jarsigner. jarsigner is "not recommended" here.

In my case jarsigner was not signing it properly, and using apksigner solved the problem.

Lorient answered 10/10, 2023 at 8:17 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.