Package signatures do not match the previously installed version

AndroidReactjsReact Native

Android Problem Overview


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.

Android Solutions


Solution 1 - Android

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

Solution 2 - Android

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.

Solution 3 - Android

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

Simply uninstall existing app will solve the problem

Solution 4 - Android

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.

Solution 5 - Android

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

Solution 6 - Android

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.)

Solution 7 - Android

> 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.

Solution 8 - Android

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.

Solution 9 - Android

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.

Solution 10 - Android

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

Solution 11 - Android

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

Solution 12 - Android

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 ;)

Solution 13 - Android

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.

Solution 14 - Android

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.

Solution 15 - Android

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

Solution 16 - Android

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.

Solution 17 - Android

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.

Solution 18 - Android

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

Solution 19 - Android

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.

Solution 20 - Android

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

Solution 21 - Android

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

Solution 22 - Android

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

Solution 23 - Android

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

No need to re-install the entire AVD.

Solution 24 - Android

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.

Solution 25 - Android

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkenpeterView Question on Stackoverflow
Solution 1 - AndroidmaxoumimeView Answer on Stackoverflow
Solution 2 - AndroidjirimertinView Answer on Stackoverflow
Solution 3 - AndroidMuhammad AshfaqView Answer on Stackoverflow
Solution 4 - Androidkira_codesView Answer on Stackoverflow
Solution 5 - AndroidA-SView Answer on Stackoverflow
Solution 6 - AndroidwaliurjsView Answer on Stackoverflow
Solution 7 - AndroidBeau SmithView Answer on Stackoverflow
Solution 8 - AndroidQazi Fahim FarhanView Answer on Stackoverflow
Solution 9 - AndroidAriel SalemView Answer on Stackoverflow
Solution 10 - AndroidWiezalditzijnView Answer on Stackoverflow
Solution 11 - AndroidFlorian KView Answer on Stackoverflow
Solution 12 - AndroidEmilio MontagnanaView Answer on Stackoverflow
Solution 13 - AndroidRafael RamonView Answer on Stackoverflow
Solution 14 - AndroidANUJ GUPTAView Answer on Stackoverflow
Solution 15 - AndroidAllen LuceView Answer on Stackoverflow
Solution 16 - AndroidmahendrenView Answer on Stackoverflow
Solution 17 - AndroidEliramView Answer on Stackoverflow
Solution 18 - Androidv.VinhView Answer on Stackoverflow
Solution 19 - AndroidJamie BirchView Answer on Stackoverflow
Solution 20 - AndroidHarshal PatilView Answer on Stackoverflow
Solution 21 - AndroidsherkhanView Answer on Stackoverflow
Solution 22 - AndroidLong NguyenView Answer on Stackoverflow
Solution 23 - Androidmingliang94View Answer on Stackoverflow
Solution 24 - AndroidTommy RiveraView Answer on Stackoverflow
Solution 25 - AndroidPlaimanus LueondeeView Answer on Stackoverflow