"Signatures do not match previously installed version" error when trying to overwrite store build

I have my game up on the Google Play Store, install from there, and play the game, writing to a save file as I go. When trying to build-and-run from the Unity Editor, I get an error about the package signature not matching the installed version. This despite it being the exact same build that has been uploaded to the store. I am required to uninstall the store version in order to get build-and-run to work from the Editor.

Can someone explain why this may occur and how I can fix it? This is the first time I’ve encountered this problem and I need to solve it so that I can test to make sure that save files for already-live builds of the game can properly be loaded by the new version I wish to publish. The save file is deleted when the game is uninstalled but not when the game is overwritten (or side-installed) by the Unity Editor (which I have been able to do in the past) or upgraded by a beta build over Google Play.

As per the documentation

Different signature could be because of different reasons

  1. You might be trying to install development build (which uses default debug.keystore) when you have release build/Google play store build installed on device
  2. You might be trying to install release build (which uses your own keystore) when you have debug build installed on device

Note that, I assume you have google play signing enabled so the the apk downloaded to your device has a different signature from your release build.

So, ideally as per the error when ever there is a signature mismatch, it throws INSTALL_FAILED_UPDATE_INCOMPATIBLE
Possible Solutions
If you are not using Google Play Signing feature (I assume this may not be the case as its more like a mandatory step), then you can just make a build with your release keystore and it should work. This is because your installation done from google play will have the same signature as your release build.

If you are using Google Play Singing feature (Most likely), Then upload a build to your internal track(unfortunately non-debug builds) and download from the internal track link.

Alternatively, If your save files are less than 3MB and are player profiles, you can make use of Saved Games (Cloud Services) of Google Play Services, which will be bounded to a profile and won’t depend on the build signature (other than for authenticating google play services).

Do share here if you find a better solution.

1 Like