Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tri

2019-01-07 03:14发布

问题:

when I tried to update my applcation with new version that has same signature as previous one, shows above error.

What I am missing?

回答1:

If you install the application on your device via adb install you should look for the reinstall option which should be -r. So if you do adb install -r you should be able to install without uninstalling before.



回答2:

You are getting that error because an application with a package name same as your application already exists. If you are sure that you have not installed the same application before, change the package name and try.

Else wise, here is what you can do:

  1. Uninstall the application from the device: Go to Settings -> Manage Applications and choose Uninstall OR
  2. Uninstall the app using adb command line interface: type adb uninstall After you are done with this step, try installing the application again.


回答3:

It might mean the application is already installed for another user on your device. Users share applications. I don't know why they do but they do. So if one user updates an application is updated for the other user also. If you uninstall on one, it doesn't remove the app from the system on the other.



回答4:

If u still facing problem then try to uninstall application using command prompt. just add command adb uninstall com.example.yourpackagename then try to re-install again.It works!



回答5:

To Install

adb install -r exampleApp.apk

(The -r makes it replace the existing copy, add an -s if installing on an emulator)

Make sure the app is signed the same and is the same debug/release variant

Bonus

I set up an alias in my ~/.bash_profile, to make it a 2char command.

alias bi="gradlew && adb install -r exampleApp.apk"

(Short for Build and Install)



回答6:

This top voted answer is not the right answer.

He is trying to update not (uninstall+reinstall) to a newer version.

Don't: uninstall the old app with adb -r; your app cache/data will be removed too!

To do it right: download the new apk on the device and install by clicking on the apk.

This will softupdate the app and keep the previous cache/app data. Installing via ADB/Android studio doesn't allow for testing a soft app update scenario. From what I see ADB seems to always throw this error irrespective of a version updated apk.