181

This my project: https://github.com/kenpeter/my_hak_news, which is a direct copy of https://github.com/grigio/HAgnostic-News.

Git clone https://github.com/kenpeter/my_hak_news, then run react-native run-android

Got this error:

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.hagnosticnews signatures do not match the previously installed version; ignoring!

Relevant issue: https://github.com/grigio/HAgnostic-News/issues/1, I follow various ways, but not able to resolve this issue.

kenpeter
  • 7,404
  • 14
  • 64
  • 95
  • 47
    Do you have the app already installed on your phone ? If so you will need to uninstall it because you are using a different signature than the original one – maxoumime Jan 17 '17 at 23:51
  • 2
    I once installed on my phone, then i uninstalled it by pressing it long, then moved to uninstall. Still not working. – kenpeter Jan 18 '17 at 00:10
  • 7
    Check if the app has been uninstalled for all the users. Go to Settings -> Apps -> HAgnostic News -> Options (the three dots on top right) -> Uninstall for all users – maxoumime Jan 18 '17 at 00:28
  • That is the solution! – kenpeter Jan 18 '17 at 00:57
  • https://stackoverflow.com/questions/41709102/package-signatures-do-not-match-the-previously-installed-version – Wiezalditzijn Dec 15 '18 at 15:07

29 Answers29

221

I met this problem on my project too.

This helped me, so hopefuly will help someone else:

adb uninstall "com.domain.yourapp"

Solution is from here.

jirimertin
  • 2,369
  • 1
  • 13
  • 9
206

You need to uninstall it because you are using a different signature than the original. If it is not working it might be because it is still installed for another user on the device. To completely uninstall, go to Settings -> Apps -> HAgnostic News -> Options (the three dots on top right) -> Uninstall for all users (Secure storage included)

zORg Alex
  • 372
  • 2
  • 15
maxoumime
  • 3,441
  • 1
  • 17
  • 23
  • 17
    Uninstalling does nothing. This error occurs even on devices that do not have the app installed. – IgorGanapolsky Jan 23 '18 at 15:43
  • 9
    @maxoimime what happens when you publish the new version to Play Store. Does the user have to uninstall the app before installing the new version? Or will the user be able to update the app without any trouble? – Peter Jan 14 '19 at 17:29
  • @maxoimime this answer works. You may consider removing your comment. It's misleading for most users – AL-zami May 20 '19 at 06:11
  • 5
    This was the problem for me too. Turns out my app was also installed in the Samsung Secure Folder. – Roman Jun 15 '19 at 05:16
  • I faced this issue because for some reasons, some previously uninstalled apps where in that "not installed for this user". But I have only one user on my phone. That's weird – Rémi Rousselet May 10 '20 at 05:32
  • 1
    @Roman Your comment was a life saver for me. I also found my app in the secure folder after uninstalling it everywhere else. Removing it there solved it. – Christoffer Mar 10 '21 at 08:38
  • holey cr*p the secure folder thing. Thank you so much, whoever was the first to point that out. – user37309 Jun 07 '21 at 10:55
  • 3
    run `adb uninstall [PACKAGE_NAME such as com.xxx.xxx]` – Xin Meng Oct 13 '22 at 16:15
25

This happens when you have installed app with diffrent versions on your mobile/emulator phone.

Simply uninstall existing app will solve the problem

Muhammad Ashfaq
  • 2,359
  • 5
  • 20
  • 46
23

If the version of the app that you have installed was not built with the same keystore/signing certificate it will have a different signature. By default each build machine will have a different debug certificate unless you specify how it should be signed according to the google documentation, which can be used to ensure that your app will be build with the same debug key regardless of which computer you build the application on.

In order to proceed with the installation you must uninstall the existing version and then try again.

kira_codes
  • 1,457
  • 13
  • 38
16

This happens mostly when the phone has the app's version from Google Play Store installed. You can either built the code with the same keystore/certificate you used for your production version, or just uninstall it from the phone and build it with your debug keystore/certificate

A-S
  • 2,547
  • 2
  • 27
  • 37
  • I am facing the same issue as mentioned in the question. Can you please let me know how can I built the code with an earlier keystore/certificate? My client provided me the keystore file but I do not know how can I built my react native android with the keystore file provided by my client. – Yousaf Iqbal Nov 23 '19 at 13:03
  • Didn't do Android for some time now, but according to this: https://developer.android.com/studio/publish/app-signing#sign_release, you should go to Build > Generate Signed Bundle/APK, and under the 'Key store path' field, press 'Choose existing...' – A-S Nov 23 '19 at 22:08
9

If you are trying to install it in an Emulator but have another phone connected to the computer via USB, detach the USB cable or disable USB debugging in the physical device. (Wasted 30min on it myself.)

waliurjs
  • 162
  • 1
  • 6
  • 1
    This was my issue. I had my phone connected to my computer to charge and was trying to run in an Emulator. – user3486427 Apr 29 '19 at 10:56
  • this is absolutely unnecessary. you can simply add `-d` after `adb` to execute actions on the USB device, or one of the others options (e.g `-t`, `-e`) to select a specific device – Ace Aug 23 '21 at 12:43
6

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to finalize session : INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package [MY REACT NATIVE APP NAME HERE] signatures do not match the previously installed version; ignoring!

I got this error when trying to install my React Native Android app on a connected device using this command:

react-native run-android --variant=release

I also had an emulator running on my computer.

Once I quit the emulator, running this command succeeded.

Beau Smith
  • 33,433
  • 13
  • 94
  • 101
6

Today, I faced the same problem on my Samsung device. In my particular case, the app was NOT showing on the phone but it was INSTALLED, so I could not uninstall/remove it. Thus I had to uninstall the app using the terminal: $ adb uninstall "com.domain.yourapp" My project tree looks like this (partial view):

└── com
    └── gluonapplication
        ├── DrawerManager.java
        ├── StartApplication.java
        └── views
            ├── PrimaryPresenter.java
            ├── PrimaryView.java
            ├── SecondaryPresenter.java
            └── SecondaryView.java

So for me, the command was: $ adb uninstall com.gluonapplication Once done, I installed the app via terminal:

$ cd /path/to/apk/
$ adb install -t myAwesomeApp.apk  # -t means test install

That is what worked for me. I hope this answer is helpfull.

Qazi Fahim Farhan
  • 2,066
  • 1
  • 14
  • 26
6

If you want to update the app and keep the data (shared pref, SQL on phone), you can get this error and you don't want to uninstall it.

Be sure to have keystore which match with previous app project.

In android > app > build.gradle, you have to specify signingConfigs like this :

android {
 signingConfigs {
  release { 
    storeFile file("../path/file.keystore")
    storePassword "password"
    keyAlias "keyAlias"
    keyPassword "keyPassword"
   }
 }
}

You can customize signingConfigs for debug, release...

It works with app developed in native and then updated to Flutter

Florian K
  • 2,033
  • 1
  • 9
  • 21
  • Yes. I am trying to Achieve the same but getting error Package com.my.app signatures do not match previously installed version; ignoring! But my Requirement is to Give Flutter App update on Existing Native Android Application. I am using the same certificate which I use to create release build for Native App. – GreenROBO Oct 21 '21 at 15:23
  • 3
    This is the first actual correct answer! Unless you never plan on publishing your app or ever upgrading it "Uninstall the old app" is just a temporary work around. Thank you @Florian – johnw182 Feb 20 '22 at 19:23
5

I ran into this error when trying to install a system app and then got this error when attempting an uninstall:

% adb uninstall com.domain.systemapp
Failure [DELETE_FAILED_INTERNAL_ERROR]

This command did the job:

% adb uninstall --user 0 com.domain.systemapp
Success
Allen Luce
  • 7,859
  • 3
  • 40
  • 53
4

This error happened to me when a previous build on my simulator / phone was being uploaded with different credentials. What I had to do was run:

adb uninstall com.exampleappname

Once I did that I was able to rerun the build and generate an APK.

Ariel Salem
  • 357
  • 3
  • 12
3

I got the same error. I uninstalled the app on my virtual device and rerun the command: 'react-native run-android'.

Wiezalditzijn
  • 443
  • 3
  • 17
2

To avoid to uninstall the app in your physical device as suggested in a previous answer, increment the "versionCode" in build.gradle file under /android folder ;)

1

I have the same problem, it was running well in AVD, but in my phone was not ok. I uninstalled the app on my phone then it's working fine.

1

In my case the issue was I had installed an app with the package name let's say com.example.package using android studio on my device. I created another app with the same package name and was trying to install it on my device. That is what was causing the problem. So just check on your device whether another app with the same package name already exists or not.

ANUJ GUPTA
  • 905
  • 13
  • 22
1

Uninstall the app from the device directly seem like still keep some cache. I find using the adb uninstall will clean the app totally.

  1. get the Package name from the error message: [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.xxx.xxx signatures do not match previously
  2. run adb uninstall [PACKAGE_NAME such as com.xxx.xxx]
Xin Meng
  • 1,982
  • 3
  • 20
  • 32
0

You need to uninstall it because you are using a different signature than the original. If it is not working it might be because it is still installed for another user on the device. To completely uninstall, go to Settings -> Apps -> (specific app)-> Options (the three dots on top right) -> Uninstall for all users.

I am also got this issue that time already installed ionic app(same package name) remove from my phone after that working perfectly.

Mahendren Mahisha
  • 1,072
  • 11
  • 9
0

I had this issue on a Samsung device, Uninstalling the app gave the same message. The problem was that the app was also installed in the phone's "Secure Folder" area. Worth checking if this is your scenario.

Eliram
  • 606
  • 2
  • 9
  • 21
0

you need uninstall completely for LG devices by using cmd adb uninstall packageName

v.Vinh
  • 15
  • 1
0

This happened to me in a React Native project when I was renaming an app's bundle ID, and it clashed with another bundle ID that I'd already used before. I fixed it by performing a re-install:

  1. Find the app on the simulator's home screen, then long-press on its app icon, and press App info, then choose "UNINSTALL".

  2. Execute react-native run android.

Jamie Birch
  • 5,839
  • 1
  • 46
  • 60
0

This occurs due to the availability of the previous version of the Application, that is not installed on the device but its data is present in the device memory. So it fails to upgrade this uninstalled application data on the device

Try this :

Go to Device Settings ==> Apps(All Apps) ==> search your App OR search for 'client' ==> In App info screen , press the triple dots option on top right corner ==> select 'Uninstall for All Users' ==> a promt appears select 'OK'

It works for me every time this error occurs

0

if app is already installed in the emulator/device so remove it then build again. Hope you will not get this problem.

sherkhan
  • 811
  • 8
  • 8
0

In my case, App was not even installed in the mobile phone and giving the error. So i followed below steps 1: install the previous version of App 2: now uninstall it 3: install new version of App

0

I deleted my project from emulator and deleted files from ProjectName\app\build\outputs\apk\google\debug

Nikita Shadkov
  • 372
  • 3
  • 11
0

All My Fellows are right but In case of other situations, one of the reason that you get this error is because instead of you Generate Signed Bundle/APK you Build Bundle(s)/APK or install it on your device directly. To avoid this error in the future, from tool bar in android studio go to Build --> Generate Signed Bundle/APK and create you apk files in this method.

StackOverflower
  • 369
  • 2
  • 12
-1

In my case, uninstall installed application in connected device resolved my problem

Long Nguyen
  • 9,898
  • 5
  • 53
  • 52
-1

Go to android studio -> AVD manager -> Select your AVD and wipe user data

No need to re-install the entire AVD.

mingliang94
  • 234
  • 2
  • 7
-1

Thanks to a combination of other people's answers in here - Qazi Fahim Farhan && Ace in particular.


My solution below:


For those with an android device - if you uninstalled the previous version and it still gives you the bug then this worked for me:

  • adb -d uninstall "com.your.applicationName"

the "-d" targets the device you have connected. I had a number of issues I faced to even get things to work fully.

In case someone has other issues unrelated to this specific questions - this was my journey below in general in case it can help others going down this rabbit hole:

  1. Setting my android USB options to PTP instead of MTP
  2. java version/system path on windows being messed up
  3. setting the grandle.properties org.gradle.java.home=C:\\Program Files\\Java\\YOUR-JDK-FOLDER-NAME - mine is jdk-11.0.5
  4. cleaning the gradle cache gradlew clean
  5. cleaning the react native cache npx react-native start --reset-cache
  6. Then finally deleting the old app and using adb -d uninstall "com.your.applicationName" to delete the certificates from you device.
  7. AVG Security Software was complaining about a file - Approve the file.
Tommy Rivera
  • 75
  • 1
  • 4
-5

Only 1 emulator or device may be open at a time. Make sure you don't have multiple emulators running.

David Harkness
  • 35,992
  • 10
  • 112
  • 134