By mtmurdock


2010-05-26 14:58:58 8 Comments

I was trying to change my default/main/startup (whatever you call it) activity by editing the androidmanifest.xml file. All i did was change the android:name property. however, this completely broke the entire app. when I try to install it fails and reads.

Installation error: INSTALL_PARSE_FAILED_NO_CERTIFICATES

When I tried to change it back to its previous state, it was still giving me the same error... What have I done?

19 comments

@Rajiv Ranjan 2019-05-22 09:40:51

I was also facing the same issue. First I generated build using V2 and installed that in mobile devices running on OS 5.1 and I got the same issue. But build was working fine on Tablet running on OS 7.0. So I generated build with V1 Jar signature and it was working fine on both the devices.

Conclusion: If you are supporting the device below android OS 7.0. Use V1 jar signature to generate the build.

@Michael Maier 2019-03-12 08:29:16

I had that problem with ionic / Visual Studio Code (Run Android on device):

I uninstalled the App on the mobile device (Settings / Apps), the error is gone and the app is starting.

@NeeK 2019-01-30 05:11:05

This problem will happen if you are installing un-signed version of APK. Check if you are install correct APK.

@Rowland Mtetezi 2018-12-18 13:17:06

In newer Android Studio versions 3.2+, if you are trying to run release install, and you have not defined any signing configurations, it will show the error prompt and install will fail. What you need to do is either run the debug build or set up the signing configuration (V1 or V2) correctly.

@JanCor 2013-04-10 11:56:09

Most of the time the solution for this error is really simple:

  1. Uninstall your apk
  2. Clean your Android project
  3. Build your Android project
  4. Install / run your apk

@Pankaj kumar 2017-03-31 15:46:15

Its because previously generated build and current is having conflict in signature version between v1(jar signature) and v2(full APK Signature),

To fix tick proper signature version under Generate Signed APK dialog

@Paul Ratazzi 2017-03-29 15:34:40

I found that this error can now also occur when using the wrong signing config. As described here, Android 7.0 introduces a new signature scheme, V2. The V2 scheme signs the entire APK rather than just the JAR, as is done in the V1 scheme. If you sign with only V2, and attempt to install on a pre-7.0 target, you'll get this error since the JARs themselves are not signed and the pre-7.0 PackageManager cannot detect the presence of the V2 APK signature.

To be compatible with all target systems, make sure the APK is signed with both schemes by checking both signature version boxes in Android Studio's Generate Signed APK dialog as shown here:

enter image description here

If only 7.0 targets are anticipated, then there is no need to include the V1 signature.

@Atul 2018-09-06 05:37:21

You saved my lots of time. Upgrading Android Studio caused nightmare of troubles. This was one of them. I wonder if SO wasn't around more than half of the Android Development would have died. Android Studio gives no clues about errors.

@Jemshit Iskenderov 2018-09-15 05:52:42

Came here twice, but i can't upvote twice.

@Kirill Karmazin 2019-02-12 14:51:41

Luckily I tested my release apk on an old device before I rolled it out on Google Play. That would be a disaster if all < Android 7.0 devices failed to install the new version. That thing with two versions should be a BIG RED POP UP DIALOG when you click to create an apk release!

@Perry 2017-03-07 05:30:38

Another way to get this error is to build using ant on macOS and have a Finder icon file (Icon\r) in the source tree of the app. It appears jarsigner can't cope with the carriage return in the filename and, although it will claim the signing is valid if you -verify the APK, it always results in an APK that wont install on a device. Ironically, the Google Drive Finder plugin is a great source of Finder icon files.

The solution is to exclude the offending files (which are useless in the APK anyway) with a specifier like this in the fileset:

    <exclude name="**/Icon&#13;" />

@Dave Webb 2010-05-26 16:13:28

Did you edit the AndroidManifest.xml directly in the .apk file? If so, that won't work.

Every Android .apk needs to be signed if it is going to be installed on a phone, even if you're not installing through the Market. The development tools work round this by signing with a development certificate but the .apk is still signed.

One use of this is so a device can tell if an .apk is a valid upgrade for an installed application, since if it is the Certificates will be the same.

So if you make any changes to your app at all you'll need to rebuild the .apk so it gets signed properly.

@mtmurdock 2010-05-26 17:20:39

great thanks, is there a button to automatically rebuild the manifest?

@HXCaine 2010-05-26 19:39:31

Just edit the manifest in Eclipse and click 'save'

@James Moore 2016-06-27 18:25:52

I got this error when I tried to install a Xamarin project built against Android N preview on a phone running api v23. Solution is to not do that.

@Red Cricket 2016-06-17 05:07:08

I was getting this error because I did release that my ant release was failing because I ran out of disk space.

@joao2fast4u 2014-08-22 13:38:32

I was having this error in my Eclipse Console. It turns out that I had two jars with the same content but different names and they were conflicting with each other. I just deleted one of them and managed to install the app on the device.

@znat 2013-11-02 19:26:08

This could happen if you try to include a .jar library that contains an AndroidManifest.xml file.

  • If it's pure Java make sure you don't include it in the .jar export
  • If it's not pure Java (meaning it's an Android project) then you have to include it as a Library Project

@Kristopher Johnson 2013-05-29 23:15:43

In my case, I could build and run release builds, but got the INSTALL_PARSE_FAILED_NO_CERTIFICATES error when trying to do a debug build.

The solution was to delete my debug.keystore file and let ADT recreate it. It had apparently expired.

A better long-term solution is to explicitly create a debug.keystore that does not expire after only a year, instead of letting ADT create it. Here is the command to do that:

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -validity 14000

When prompted, enter these values:

  • First and last name: Android Debug
  • Organizational unit: Android
  • Name of organization: Unknown
  • City or Locality: Unknown
  • State or Province: Unknown
  • Country code: US

@Nelson R. 2012-05-03 18:28:30

After some time and multiple online threads on the subject I managed to fix my project.

It's mainly taking into consideration the last files (could be images or layouts) that you put in. If you delete them, it will work out, and you can build your project again.

@Alejadro Xalabarder 2012-08-20 23:07:10

solved (for me) using in keytool the args

-sigalg MD5withRSA -keyalg RSA -keysize 1024

and using in jarsigner

-sigalg MD5withRSA -digestalg SHA1

solution found in

What kind of pitfals exist for the Android APK signing?

@Enrico Ros 2013-11-08 22:41:14

Thanks, fixed the problem for me too (I have JDK 7).

@Federico 2014-07-25 20:46:09

I've fixed it the same way, since I use appcelerator titanium and don't have access to the apk generation script. Note this solutions requires the regeneration (change!) of the private key.

@Chloe 2012-04-10 04:58:38

I found this was caused by my JDK version.

I was having this problem with 'ant' and it was due to this CAUTION mentioned in the documentation:

http://developer.android.com/guide/publishing/app-signing.html#signapp

Caution: As of JDK 7, the default signing algorithim has changed, requiring you to specify the signature and digest algorithims (-sigalg and -digestalg) when you sign an APK.

I have JDK 7. In my Ant log, I used -v for verbose and it showed

$ ant -Dadb.device.arg=-d -v release install
[signjar] Executing 'C:\Program Files\Java\jdk1.7.0_03\bin\jarsigner.exe' with arguments:
[signjar] '-keystore'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\release.keystore'
[signjar] '-signedjar'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\bin\PairFinder-release-unaligned.apk'
[signjar] 'C:\cygwin\home\Chloe\pairfinder\bin\PairFinder-release-unsigned.apk'
[signjar] 'mykey'
 [exec]     pkg: /data/local/tmp/PairFinder-release.apk
 [exec] Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

I signed the JAR manually and zipaligned it, but it gave a slightly different error:

$ "$JAVA_HOME"/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore release.keystore -signedjar bin/PairFinder-release-unaligned.apk bin/PairFinder-release-unsigned.apk mykey
$ zipalign -v -f 4 bin/PairFinder-release-unaligned.apk bin/PairFinder-release.apk
$ adb -d install -r bin/PairFinder-release.apk
        pkg: /data/local/tmp/PairFinder-release.apk
Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]
641 KB/s (52620 bytes in 0.080s)

I found that answered here.

How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstallation

I only needed to uninstall it and then it worked!

$ adb -d uninstall com.kizbit.pairfinder
Success
$ adb -d install -r bin/PairFinder-release.apk
        pkg: /data/local/tmp/PairFinder-release.apk
Success
641 KB/s (52620 bytes in 0.080s)

Now I only need modify the build.xml to use those options when signing!

Ok here it is: C:\Program Files\Java\android-sdk\tools\ant\build.xml

            <signjar
                    sigalg="MD5withRSA"
                    digestalg="SHA1"
                    jar="${out.packaged.file}"
                    signedjar="${out.unaligned.file}"
                    keystore="${key.store}"
                    storepass="${key.store.password}"
                    alias="${key.alias}"
                    keypass="${key.alias.password}"
                    verbose="${verbose}" />

@Ixx 2012-05-11 10:38:55

JDK 7 was also my problem. I was lazy and uninstalled JDK 7 and installed JDK 6, also worked ^^. Other hack solution but less radical could be let both installed but set JAVA_HOME to JDK 6 and put bin path of JDK 6 first in PATH.

@Chris Xue 2014-08-14 21:56:57

JDK 8 has the same problem. Changing PATH to JDK 6 worked. Thank you lifesaver!

@Sileria 2014-10-17 14:44:07

Thanks! My market app was compiled with JDK6. When I compiled the app with release keystore using JDK7 and tried to install, it gave me this problem.

@TN. 2012-06-04 09:16:24

Setting environment variable JAVA_HOME to JDK 5 or 6 (instead of JDK 7) fixed the error.

@Ixx 2012-05-11 10:44:18

This is an ugly but fast solution: use JDK 6 instead of 7.

After read Chloe's answer, I uninstalled my JDK 7 (don't need it currently anyways) and installed JDK 6. That fixed it. A better solution would make ant uses JDK 6 (without uninstalling 7). Maybe possible changing / setting this property:

java.library.path

in local.properties file. It's in the project directory (root).

Android doesn't work with JDK 7 anyways (only 6 or 5), so make that the ant script also uses JDK 6 or 5 is probably a good solution.

Related Questions

Sponsored Content

33 Answered Questions

28 Answered Questions

[SOLVED] What is 'Context' on Android?

17 Answered Questions

[SOLVED] "Debug certificate expired" error in Eclipse Android plugins

43 Answered Questions

20 Answered Questions

[SOLVED] What is the difference between gravity and layout_gravity in Android?

16 Answered Questions

[SOLVED] What is the difference between match_parent and fill_parent?

10 Answered Questions

8 Answered Questions

[SOLVED] Android error: Failed to install *.apk on device *: timeout

Sponsored Content