50

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?

1

3 Answers 3

44

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.

5
  • 6
    zipalign -v apkfile is not sufficient, you need to execute zipalign -v 4 apkfile you need to provide align size.
    – DevZer0
    Feb 26, 2014 at 9:10
  • 4
    Also, I have been told that you need to run zipalign last, or jarsigner breaks the alignment.
    – Erhannis
    Mar 29, 2014 at 2:42
  • 2
    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?]
    – LRDPRDX
    Jul 24, 2018 at 10:17
  • 2021 and also getting this same error as @LRDPRDX . Any solution?
    – DARKGuy
    Apr 22, 2021 at 23:09
  • 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.apk Jun 11 at 20:32
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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.