39

The same Android project is built in debug mode, sometimes with Eclipse, sometimes with ant (on build machine).

If I first install the ant build, and then try to start Eclipse debugging, the Eclipse console displays

[2012-03-20 13:32:26 - myproject] Re-installation failed due to different application signatures. [2012-03-20 13:32:26 - myproject] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2012-03-20 13:32:26 - myproject] Please execute 'adb uninstall com.myproject' in a shell. [2012-03-20 13:32:26 - myproject] Launch canceled!

If I do this the other way around, i.e., debug with Eclipse (includes installing the apk) and then try to install the ant build from command line, I get:

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

What is wrong with my certificates/signing?

Juuso Ohtonen
  • 8,826
  • 9
  • 65
  • 98
  • possible duplicate of [How to deal with INSTALL\_PARSE\_FAILED\_INCONSISTENT\_CERTIFICATES without uninstallation](http://stackoverflow.com/questions/3185444/how-to-deal-with-install-parse-failed-inconsistent-certificates-without-uninstal) – ForeverLearning Aug 05 '15 at 20:57

8 Answers8

73

For me the problem was I had the same application already installed with another key. Uninstalling the old application solved the problem, as noted here:

https://stackoverflow.com/a/10280878

Community
  • 1
  • 1
f.cipriani
  • 3,357
  • 2
  • 26
  • 22
37

The old installed .apk has different certificate than the new going to be installed or it is already installed in your device with a different key. This means that your application was previously installed from a different machine that gave it different credentials.

So the solution is:

uninstall the existing .apk

and then

re-install the new .apk

Sonhja
  • 8,230
  • 20
  • 73
  • 131
18

The problem is that the apk files (during Eclipse and ant build) have been signed with different certificates. To make the signatures consistent between builds that have been built on different machines, place the debug keystore in version control:

This is handy if you tend to cross-install builds from your own machine and build machine.

Community
  • 1
  • 1
Juuso Ohtonen
  • 8,826
  • 9
  • 65
  • 98
  • I have the same problem, but it's on the same machine, project and directory. It's as if ant and eclipse are not using the same (debug) keystore...used to work, but I updated to Android Tools 20 recently. – Andrew Mackenzie Jul 18 '12 at 18:41
5

If your building system is gradle, just use the follwong command to uninstall it in Windows:

.\gradlew.bat uninstallDebug

or in Linux:

./gradlew uninstallDebug

And then:

./gradlew install

This is a certification check for installation and uninstallation on the same package in Android. If you are using two different building PC (computer) connected with the same phone, you'll get this error when you connect your phone with those different PCs. The best choice is binding one PC with one physical phone.

techraf
  • 64,883
  • 27
  • 193
  • 198
Clock ZHONG
  • 875
  • 9
  • 23
  • Does it have anything to do with the question? – techraf Mar 28 '16 at 06:02
  • 1
    techraf, yes, following the process described here could help you resolve this problem. It's very possible that the INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES is caused by different developing hosts. Using different developing hosts to reinstall the same package will show this error, if so, just uninstall the package first. – Clock ZHONG May 22 '18 at 03:18
1

Open Eclipse's Preferences. Open Android section in left list. Select "Build" area under Android Beside "Custom debug store" navigate to the keystore under your Android SDK instalation, NOT the one Eclipse has selected under your home directory.

Now the android ant build and eclipse are using the same keystore.

Andrew Mackenzie
  • 5,477
  • 5
  • 48
  • 70
1

In IntelliJ although you can select a debug keystore for debug signing your applications you can not enter keystore password or keypassword. You could export your release certificates and import them to your debug keystore and change keystore and key passwords to "android". I have prepared step by step instructions for it: http://www.denizoguz.com/2013/01/12/failure-install_parse_failed_inconsistent_certificates/

Deniz
  • 1,575
  • 1
  • 16
  • 27
0

Other solution Incremente your version code on build.gralde file of your application

 defaultConfig {
        ...
        versionCode 1
        ...
  }

 defaultConfig {
        ...
        versionCode 2
        ...
  }

Sync Now enter image description here

Build clean Project

Run your application

Anthone
  • 2,156
  • 21
  • 26
0

On flip-phones (e.g. LG Classic Flip), the application ID needs to start with com.android.cts. And make sure that the namespace and applicationId are the same in

android {
    namespace "..."
    defaultConfig {
        applicationId "..."
    }
}
Sam
  • 261
  • 2
  • 11