INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES when install app for the first time

Android

Android Problem Overview


I am trying to build and sign an app manually, but I keep getting INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES when installing to the emulator, before I even succeeded installing once.

Just in case, I have attempted to uninstall the app (yes, I gave the right Java package name), but it didn't solve the problem.

I have also tried restarting the emulator and marking the "Wipe User Data" checkbox.

The package name includes our company name, so it could not clash with internal packages.

I haven't found in the internet any other explanation to the error except for "you have another version of the same app already installed", so I'm kind of stuck here.

Thanks!

Android Solutions


Solution 1 - Android

I ran into this issue, too, and the reason was I had the same application already installed, but signed with different key (DEBUG key vs. release key). Removing the old installation manually and reinstalling solved this.

Solution 2 - Android

This worked for me:

  • go to settings
  • then select apps
  • select the downloaded onces
  • select the app and Uninstall for all users.

Then everything worked like a charm.

Solution 3 - Android

Maybe it's not signed correctly? Try to build it with Eclipse or the SDK Ant tasks and compare the APKs. Or use jarsigner to check the signature and make sure it's what you expect.

Solution 4 - Android

I had APK already on the device > deleting it solved it for me > TNX

Solution 5 - Android

I came across this today, and it appears the act of signing the APK more than once that causes this.

When I build with the standard 'ant debug', which automatically signs with the debug keystore, then add files to the APK and resign it with the debug keystore, all steps and verifications give me the expected results, but upon install on a newly factory-reset machine I get this message.

When I build with the standard 'ant release', skipping the password request by pressing Ctrl-C, then add files to the APK and resign it with my private keystore, everything works as expected.

You can use the standard methods to build your APK files, but before you resign it, you need to delete the META-INF directory inside the APK file to unsign it. On Linux/Mac, you can use the command zip -d yourapp.apk "META-INF*".

One more thing: some people have reported problems doing unsign/sign operations on aligned APK files, so if you have the option, you should probably operate on the unaligned ones, then zipalign as the final step.

Solution 6 - Android

This is the only thing that worked for me:

$ adb uninstall com.example.testproj

Hope it helps

Solution 7 - Android

For each new build, we are running tests on the emulator. Because we wanted to start from a known configuration with each new test run, we are creating a new AVD each time, after deleting the old one:

> android delete avd -n ${EMULATOR}
> android create avd -n ${EMULATOR} -t 26

Even on this newly-created AVD, we were seeing:

> Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]

when installing both the APK to be tested and the JUnit test APK.

What appears to have worked for us is to run:

> adb uninstall my.app.name
> adb uninstall my.app.name.test

on the newly created emulator, even though this results in

> Failure

The eventual installation (after build) shows:

> [exec] 1174 KB/s (4430116 bytes in 3.683s)
> [exec] pkg: /data/local/tmp/MainActivity-debug.apk
> [exec] Success

for both APK under test and the testing APK.

Solution 8 - Android

try to delete app on the device and then run in ice

Solution 9 - Android

I solved this by just removing old app by uninstalling from the device and build again.

Solution 10 - Android

  1. Change package name in manifest.xml (example give = package="com.first.rss")
  2. Change name in src
  3. Right click > Refactor > Rename... And give a name.

Solution 11 - Android

Just if someone else got this failure, and none of the above solution work, make sure to disable admin privileges for you app if you requested it.

Solution 12 - Android

Had the same issue when working on the app from multiple machines. Despite uninstalling the app from my device, the issue persisted. I found however that the package was still installed for other users on the device.

On your device go to Settings > Applications and click on the package. Then click the menu/option button and select 'Uninstall for all users'.

This should allow the app to install on your device again.

Solution 13 - Android

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

Solution 14 - Android

If you have guest users in your device switch to guest user check if your native app is installed already in guest user account delete it Or remove guest user your choice and then run application. Hope this helps!

Solution 15 - Android

That could happen when package in AndroidManifest is different from the package in Java files

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
QuestionRamon SnirView Question on Stackoverflow
Solution 1 - AndroidZdsView Answer on Stackoverflow
Solution 2 - AndroidJyoti PrakashView Answer on Stackoverflow
Solution 3 - AndroidNikolay ElenkovView Answer on Stackoverflow
Solution 4 - AndroidKim David HauserView Answer on Stackoverflow
Solution 5 - Androidn8n8babyView Answer on Stackoverflow
Solution 6 - AndroidDarklandView Answer on Stackoverflow
Solution 7 - AndroidPeter K.View Answer on Stackoverflow
Solution 8 - AndroidBillView Answer on Stackoverflow
Solution 9 - AndroidMahendra PratapView Answer on Stackoverflow
Solution 10 - AndroidSerkan KaanView Answer on Stackoverflow
Solution 11 - AndroidMostrapotskiView Answer on Stackoverflow
Solution 12 - AndroidAWebsterView Answer on Stackoverflow
Solution 13 - AndroidOgnyanView Answer on Stackoverflow
Solution 14 - AndroidNikhil GoswamiView Answer on Stackoverflow
Solution 15 - AndroidRyanView Answer on Stackoverflow