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!
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.
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.
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.
I had APK already on the device > deleting it solved it for me > TNX
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.
This is the only thing that worked for me:
$ adb uninstall com.example.testproj
Hope it helps
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.
try to delete app on the device and then run in ice
I solved this by just removing old app by uninstalling from the device and build again.
- Change package name in manifest.xml (example give = package="com.first.rss")
- Change name in src
- Right click > Refactor > Rename... And give a name.
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.
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.
I had this problem trying to execute gradle task connectedDebugAndoidTest
(or connectedAndroidTest
) against Genymotion. Running it on normal emulator solved the problem.
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!
That could happen when package in AndroidManifest is different from the package in Java files
精彩评论