Reputation: 7560
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!
Upvotes: 65
Views: 70902
Reputation: 3623
I solved this by just removing old app by uninstalling from the device and build again.
Upvotes: 2
Reputation: 826
That could happen when package in AndroidManifest is different from the package in Java files
Upvotes: 0
Reputation: 81
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!
Upvotes: 0
Reputation: 13600
I had this problem trying to execute gradle task connectedDebugAndoidTest
(or connectedAndroidTest
) against Genymotion. Running it on normal emulator solved the problem.
Upvotes: 0
Reputation: 4017
This worked for me:
Then everything worked like a charm.
Upvotes: 22
Reputation: 353
This is the only thing that worked for me:
$ adb uninstall com.example.testproj
Hope it helps
Upvotes: 5
Reputation: 141
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.
Upvotes: 1
Reputation: 424
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.
Upvotes: 1
Reputation: 19
Upvotes: 1
Reputation: 8108
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.
Upvotes: 3
Reputation: 99
I had APK already on the device > deleting it solved it for me > TNX
Upvotes: 8
Reputation: 4359
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.
Upvotes: 173
Reputation: 493
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.
Upvotes: 5
Reputation: 52936
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.
Upvotes: 9