We have written a new version of an Android app to upgrade an old one, but would like to extract login username from old apps SharedPreferences on first run after upgrade before overwriting the whole thing with the new data model. build.gradle of the new codebase specifies a newer versionName and versionCode, yet when we try to run from Android Studio onto a device that had the old app installed we get a dialog box with the following error message:
Installation failed since the device already has a newer version of this application.
In order to proceed, you have to uninstall the existing application.
WARNING. Uninstalling will removed the application data!
Do you want to uninstall the existing application?
[OK] [Cancel]
Obviously if we accept it uninstalls the old app along with all the user data and we cannot achieve what we intended.
Cannot find anything on the internet regarding this problem
OLD APP build.gradle:
versionCode 1
versionName '1.4.1'
NEW APP build.gradle:
versionCode 2
versionName '2.0.0'