Phillip Fitzsimmons
Phillip Fitzsimmons

Reputation: 2945

Installation error: INSTALL_PARSE_FAILED_NO_CERTIFICATES

At the risk of repeating what appears to be a very common complaint, I think I have a substantial variation on this bug.

The application won't install from Eclipse and this appears in the console: Installation error: INSTALL_PARSE_FAILED_NO_CERTIFICATES.

LogCat provides some illumination: Package com.xxx has no certificates at entry assets/fonts/helvetica_neue.ttf; ignoring!

Meaning that the device (or emulator) believes that this particular file wasn't signed.

The usual solutions proposed for this are:
- Rename the offending file. We've tried that, it then complains about the next file, then the next, and so on.
- Add a dummy file. Tried that too. It complains about the new file, regardless of what it's called.
- Compile for greater than Android 1.6. We're compiling for 2.3.

It's worth noting this only happens when we launch a unit test. We can install the "real" application on its own with no difficulties. We're also using Maven and, of course, the Maven Android plugin.

Any insights or suggestions would be very welcome and of course if we figure it out on our own I'll post any findings.

Upvotes: 19

Views: 54280

Answers (7)

Cícero Moura
Cícero Moura

Reputation: 2333

For those with this problem...

Select V1 (jar signature) instead of V2 (full apk signature)

Selecting V2 could also cause this problem.

enter image description here

Upvotes: 7

Chris Thompson
Chris Thompson

Reputation: 11

Had the same problem, it was that I was configured to use the App Store instead of debug under the Android target configuration, and I hadn't set up the app store yet. Switched back to debug and it was fine.

Upvotes: 1

Anno2001
Anno2001

Reputation: 1363

choose Java SE 6 in the Java preference app

Upvotes: 0

derekerdmann
derekerdmann

Reputation: 18252

I encountered this through normal debugging - while it's unlikely to help all the time, simply going to Project -> Clean and rebuilding everything may be enough to clear the error.

Upvotes: 16

Chloe
Chloe

Reputation: 26264

I found it was due to 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. I can't speak for your Maven, but it is probably the same issue. 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!

Upvotes: 10

Alfredo
Alfredo

Reputation: 11

I had this problem with MotoDev 3.0.0

The solution was to delete emulator and create a new one.

In fact, you do not need to delete the old emulator, just create a new one and installation goes smoothly.

Upvotes: 1

Phillip Fitzsimmons
Phillip Fitzsimmons

Reputation: 2945

This is fixed now. Should someone find themselves with the same unique project setup and bug the solution may be of some value.

The problem stemmed from the configuration of our resource directories in the POM of our test project (the project containing our unit tests). They were pointing to the resource directories of the project being tested. This set up should work so I'm going to guess that it's a bug in the Maven Android plugin that causes the resources to remain unsigned.

So the solution was to remove the references to external resource directories (I can't say why it was done that way initially but removing them appears to have no ill effects) and configure the resource directories in the standard way (taking as an example the POM provided by the maven plugin project archetype with tests).

Upvotes: 2

Related Questions