A way to prevent update issues when distributing via APKs and the Play Store (Scriptoria)

Hello,

Due to our target audience’s limited internet connectivity, we distribute our apps via both the Play Store and by sharing APK files.

We also update our Play Store listing with Scriptoria.

What I have found is that, with failed builds and whatnot, Scriptoria was automatically incrementing the version name and code of our apps, quite a bit more than what we had set in SAB. So for example, I would share the APK from SAB with version code 4, and the Play Store code would be 15. Later I would release an update that was version code 5 on SAB, but 17 in the Play Store.

Users who had installed the app via the Play Store were unable to update with the APK, because the phone would see version 15 installed, but that the APK the user was trying to install was just version 5.

(Additionally at one point the app entered a “failed state” in the Play Store and I had to upload an updated APK directly. I got error messages saying that the uploaded APK had an inferior version code to the one present in the Play Store.)

Eventually I figured out what was happening with the version codes. The user workaround was to uninstall and then reinstall the app (rather than trying to update).

As a developer, I have configured Scriptoria to use the same version code and name as set in SAB, to prevent these kinds of issues from happening again. This is how:

I am just sharing my experience with the larger community in case anyone else finds it to be helpful.

Thank you.