I'm developing a new version of an existing app. This is a complete redesign from the ground up, so I've created a separate project for this update. Now I need to test the app's behavior when upgrading from v2 (old version) to v3 (new version). The two projects have the same applicationId, module name, and are signed by the same key. However, when I install v2, and then subsequently install v3, the old app is not overwritten; I end up with two installs. What am I missing that is causing Android to view these apps as distinct?
Two APKs cannot both be installed on the device if the have the same application ID. The module name doesn't matter, and a different signing key would just force a complete uninstall/reinstall instead of an update.
Double check your application IDs for minor typos.
Also check if you have an applicationIdSuffix
defined in your build.gradle. It is fairly common to append something like .debug
to debug builds so you can have both a debug and release build installed on your device. If that's the case, make sure you are trying the upgrade with a release build.
You can also log (or show the application ID) in a Toast to verify that they are different and what you expect. Just call BuildConfig.APPLICATION_ID
to get the current application ID.