How to deal with INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES without uninstall?

AndroidApk

Android Problem Overview


I tried to reinstall an apk

$adb install -r new.apk

And it shows the error:

Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

One solution is to uninstall and install the new.apk, that works fine.

But I'm wondering whether I could re-build an apk and re-install without the uninstallation. Eg. change some config in the AndroidManifest.xml, or not sign the APK, etc.

It would be great appreciated if you could tell me the whole meaning of the "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES".

Android Solutions


Solution 1 - Android

It means the new copy of your application (on your development machine) was signed with a different signing key than the old copy of your application (installed on the device/emulator). For example, if this is a device, you might have put the old copy on from a different development machine (e.g., some other developer's machine). Or, the old one is signed with your production key and the new one is signed with your debug key.

Solution 2 - Android

I ran into this while testing on a new Xoom. I had previously installed my app from the Marketplace. Later while trying to test a new version of the app I ran into this error.

I fixed it by removing the app that was installed via Marketplace (just hold and drag to the trash). Thereafter I was able to deploy my development version without any issue.

Solution 3 - Android

This happened to me when another developer on the team built our app on the hardware device I was trying to deploy to. Uninstalling the app from hardware fixed my problem.

Solution 4 - Android

This is the command to uninstall the app from device using adb:

adb uninstall <package name>

Solution 5 - Android

I got this error even after uninstalling the original APK, which was mystifying. Finally I realized that I had set up multiple users on my Nexus 7 for testing and that the app was still installed for one of the other users. Once I uninstalled it for all users the error went away.

Solution 6 - Android

I changed the package name while coding an update so that I could debug it on my device via Eclipse, without deleting the old version that was installed. Without reverting the package name I was using when trying to reinstall, I got this same error. Using the same package name the reinstall was successful.

Solution 7 - Android

I faced an another use case where I got the similar error. When At first I got the error, I panicked, and removed /data/data/{package.name} After that I tried, and my problem was still present. Then I tried uninstall, it failed.

I then removed the apk file present in /system/app (required root access), and tried uninstall and it was successfull.

After that I tried re-installing the apk, it worked.

Solution 8 - Android

Just delete the old build from the device and reinstall the same. Because device.keystore is already exist in the device so just uninstall the build and reinstall the APK thats all..

Thanks

Solution 9 - Android

If you encounter a failed deployment to an Andorid device or emulator with the error "Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]" in the Output Window, simply delete the existing app on the device or emulator and redeploy. Debug builds will use a debug certificate while Release builds will use your configured certificate. This error is simply letting you know that the certificate of the app installed on the device is different than the one you are attempting to install. In non-development (app store) scenarios, this can be indicator of a corrupted or otherwise modified app not safe to install on the device.

Solution 10 - Android

I had the same problem until I realised I had the simulator running and adb was trying to install on that

Solution 11 - Android

For what it is worth, I ran into this problem after adding a new plugin to my Cordova project. I had been having cordova do builds and install directly on the device via USB.

I fixed it by uninstalling the app from the device and on the next deploy there were no problems.

Solution 12 - Android

Nothing from above worked for me. The problem for me was that I had wrong source in my Java Build Path for android-support-v7-appcompat. When you go to Project> Build Path> Configure Build Path>. Under the Source tab make sure you have android-support-v7-appcompat/gen , android-support-v7-appcompat/libs and android-support-v7-appcompat/src and nothing else. Click OK and it should work.

Solution 13 - Android

I've had the same error today, but the problem wasn’t exactly the same. I’m using ADB with Android installed in VirtualBox. I tried to install different versions of my app (signed / not signed, debug / release mode) and got two errors alternatively : INSTALL_FAILED_UID_CHANGED and INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES.

Now, when looking at /data/data/{package.name}, I found a bunch of files that were still there after uninstalling the app. I tried to rm -rf them without success : I got I/O errors.

The solution to this was :

  • Shut down the VM
  • Mount the VDI image with vdfuse (read/write)
  • Repair the Partition1 image file with e2fsck
  • Umount and restart the VM

Solution 14 - Android

Since the verification is based on package's name, you can change the package name inside your config.xml or manifest file for another name you want.

When publishing your app don't forget to change back the name!

Solution 15 - Android

I had this problem trying to execute gradle task connectedDebugAndoidTest (or connectedAndroidTest) on Genymotion. Running it on normal emulator solved the problem.

Solution 16 - Android

I think , your app installed by other account.( multiple account mode feature ) You can uninstall app in Setting>Apps>"app name"> Uninstall

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJohnnyView Question on Stackoverflow
Solution 1 - AndroidCommonsWareView Answer on Stackoverflow
Solution 2 - AndroidGeorge ArmholdView Answer on Stackoverflow
Solution 3 - AndroidsupermoogleView Answer on Stackoverflow
Solution 4 - AndroidPaulView Answer on Stackoverflow
Solution 5 - AndroidinkyView Answer on Stackoverflow
Solution 6 - AndroidEdwardView Answer on Stackoverflow
Solution 7 - AndroidArunkumarView Answer on Stackoverflow
Solution 8 - Androiduser1330971View Answer on Stackoverflow
Solution 9 - AndroidLinda ZView Answer on Stackoverflow
Solution 10 - AndroidMartin LockettView Answer on Stackoverflow
Solution 11 - Androiduser107498View Answer on Stackoverflow
Solution 12 - AndroidImmortal CodeView Answer on Stackoverflow
Solution 13 - AndroidJérômeView Answer on Stackoverflow
Solution 14 - AndroidRaphaelView Answer on Stackoverflow
Solution 15 - AndroidOgnyanView Answer on Stackoverflow
Solution 16 - AndroidNguyễn Quang TuấnView Answer on Stackoverflow