INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES on adb install

android, android-install-apk, apk, eclipse, signing

Solution

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:

- Use keytool-importkeypair to make the key/certificate pair: https://stackoverflow.com/a/4257367/1097104

- Place the created keystore file in version control

- Set Eclipse to use the file: Windows > Preferences > Android > Build

- Set ant properties to use the file: https://stackoverflow.com/a/9019925/1097104

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

Problem

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?

Original source

Related problems