419

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

What I am missing?

7 Answers 7

806

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.

8
  • 1
    adb install -r does not always work (I've got an EVO 4G from Sprint that refuses to behave as expected). The only work around I've found is to remove the application manually. Sometimes, I even have to do it through the phone's UI because the EVO is so temperamental.
    – jww
    Feb 10, 2014 at 4:46
  • 28
    I came here because I wanted to know whether adb install -r would remove first and then install or upgrade my app. Although adb's description is not very clear (-r: replace existing application), adb install -r does indeed upgrade your app and does not remove your app data. Therefore suitable to test upgrading your app (which is the information I was looking for). Jan 13, 2016 at 7:16
  • 8
    To people claiming adb install -r does not work: I guess that the .apk file you are trying to install was not signed with the same developer certificate as the .apk file installed on device. Easily happens if you have installed a Debug app and then are trying to install the Release app or the other way around. You cannot update an application if it is not signed with the same certificate. Jan 13, 2016 at 7:20
  • 1
    If you use multiple accounts, you may have to uninstall from all accounts (see GregP's answer). This worked for me after I did that. Nov 24, 2016 at 19:33
  • does not work , my app is a system app, and this is not solving my issue :/
    – htafoya
    Nov 25, 2016 at 0:21
12

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)

11

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
  • My app was not coming up under the menu, or app store - but found it thanks to Muhammad's tips.
    – DavidP
    Nov 6, 2012 at 19:14
  • 2
    This is not a good solution. What if you have a bunch of state like SharedPrefs saved in the app? If you hard uninstall from the system, you'll have to reconfigure your app all over again! Jun 30, 2016 at 20:45
  • This was the solution I needed, adb uninstall my.package. Oddly, it did not uninstall the prefs that I wanted removed, but it did get rid of the package, which was the thing that was blocking me from reinstalling it.
    – JMD
    Jan 27, 2017 at 0:00
6

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.

2
  • This was my exact problem! Kept trying to uninstall - both with adb and manually, but adb install <package.apk> kept failing even though the app was no longer visible in the app list. Turns out it was still there on the other account on my device... Thanks! Nov 24, 2016 at 19:30
  • This fixed it for me too. For info on a device to unsinstall for all users I had to go to Settings>Apps tap the App, tap the ellipses on the top right and tap Uninstall For All Users.
    – d219
    Dec 19, 2018 at 14:01
1

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!

1

With my Android 5 tablet, every time I attempt to use adb, to install a signed release apk, I get the [INSTALL_FAILED_ALREADY_EXISTS] error.

I have to uninstall the debug package first. But, I cannot uninstall using the device's Application Manager!

If do uninstall the debug version with the Application Manager, then I have to re-run the debug build variant from Android Studio, then uninstall it using adb uninstall com.example.mypackagename

Finally, I can use adb install myApp.apk to install the signed release apk.

1

This can also be caused if the application was built from different PCs. You can make it easier for your whole team if you copy a debug.keystore from someone's machine into a /cert folder at the top of your project and then add a signingConfigs section to your app/build.gradle:

  signingConfigs {
    debug {
      storeFile file("cert/debug.keystore")
    }
  }

Then tell your debug build how to sign the application:

  buildTypes {
    debug {
      // Other values 
      signingConfig signingConfigs.debug
    }
  }

Check this file into source control. This will allow for the seamless install/upgrade process across your entire development team and will make your project resilient against future machine upgrades too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.