Updated APK Won't Run on Android Device

Hi guys

I have been following through the getting started tutorial which is going well but I am having an issue when trying to build and install a modified version of the same program. The first time I built and installed ‘Star Explorer’ on my device it worked fine. I then modifed the code to implement the high score and attempted the build again this time updating the version and version name in the build process. When I installed the new apk however it did not run my updated version instead running the same version that was installed the first time.

I tried uninstalling and building again which didn’t work. The only way I could get it to run the new version was to change the application name to ‘Star Explorer 2’. I am not sure why it doesn’t update properly. Does anyone know how I can get it to update without having to change the name each time I want to build a modified version of the same code.

Kind Regards

Can you tell us how you’re updating the app on your device?

Rob

At the moment I have been building the apk and storing it in a folder in my documents. I then connect my phone and copy the apk to my micro sd card. On my phone I navigate to the apk tap it and click install.

Ive tried deleting the old apk and uninstalling the app but the problem still persists

Are you using a Mac or Windows to build with?

If you’re on a Mac, the build dialog has a selection to let the Simulator build and install it on the device for you. If you’re on Windows (and this even works on Macs) you should have installed the “Android Debug Bridge” tools or “adb”. You can bring up a command prompt (cmd.exe on Windows, Terminal or macOS) and do:

adb install -r appname.apk

To install your app from your computer. Of course I didn’t include any paths to adb if it’s not in search path, nor did I include the path to the APK as well.  The -r means replace.

Can you try one of those options and see if your behavior changes?

Thanks

Rob

That works perfectly. Thank you so much for all your help

Can you tell us how you’re updating the app on your device?

Rob

At the moment I have been building the apk and storing it in a folder in my documents. I then connect my phone and copy the apk to my micro sd card. On my phone I navigate to the apk tap it and click install.

Ive tried deleting the old apk and uninstalling the app but the problem still persists

Are you using a Mac or Windows to build with?

If you’re on a Mac, the build dialog has a selection to let the Simulator build and install it on the device for you. If you’re on Windows (and this even works on Macs) you should have installed the “Android Debug Bridge” tools or “adb”. You can bring up a command prompt (cmd.exe on Windows, Terminal or macOS) and do:

adb install -r appname.apk

To install your app from your computer. Of course I didn’t include any paths to adb if it’s not in search path, nor did I include the path to the APK as well.  The -r means replace.

Can you try one of those options and see if your behavior changes?

Thanks

Rob

That works perfectly. Thank you so much for all your help