Package signatures do not match the previously installed version

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.


Solution 1:

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:

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:

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:

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.