Search code examples
androidandroid-install-apk

Android App Not Install. An existing package by the same name with a conflicting signature is already installed


In my emulator, when I try to do an upgrade of my apk programmatically. I get:

Android App Not Install.

An existing package by the same name with a conflicting signature is already installed

enter image description here

I'm still in the testing phase of this upgrade, so the file I download is a signed apk of a previous version, which I think should work without any issues.

From the suggestion in: an existing package by the same name with a confilcting signature is already installed I tried to run the emulator both in debug mode and in normal mode... neither worked.

Any thoughts on what I'm missing?


Solution

  • The problem is the keys that have been used to sign the APKs, by default if you are running directly from your IDE and opening your Emulator, the APK installed in the Emulator is signed with your debug-key(usually installed in ~/.android/debug.keystore), so if the previous APK was signed with a different key other than the one you are currently using you will always get the signatures conflict, in order to fix it, make sure you are using the very same key to sign both APKs, even if the previous APK was signed with a debug-key from another SDK, the keys will definitely be different.

    Also if you don't know exactly what key was used before to sign the apk and yet you want to install the new version of your app, you can just uninstall the previous application and reinstall the new one.