Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android In-App update API return 0 as availableVersionCode & updateAvailability as 1 (UPDATE_NOT_AVAILABLE)

I'm trying to implement the in-app update API, followed in-app-update-api, when debugging the app with lower version than play store version, AppUpdateInfo return availableVersionCode as 0 and updateAvailability as 1 (UPDATE_NOT_AVAILABLE), Note: I've used the same package name & same signing key to run a build

Thanks in advance!

like image 530
Moorthy Avatar asked May 22 '19 09:05

Moorthy


1 Answers

The most likely reason is that the Play Store on your device hasn't learnt about the new update yet.

After you release your update in the Play Developer Console, the information about this update does not reach immediately all devices; some Play Store background job on the device is responsible for periodically checking for updates for installed apps and refresh the on-device cached information.

"But I want to test the behaviour on my device now, I don't want to wait for a background job to complete before I can test. Can I force the refresh of this cache?"

Yes, take a look at the last item of the Troubleshooting section here: https://developer.android.com/guide/app-bundle/in-app-updates#troubleshoot To refresh the cache you need to: close the Play Store; reopen it; navigate to the "My Apps & Games" app.

"Will my users need to do this too?"

No: your users can just wait for the background job to run.

like image 163
Alessandro Dovis Avatar answered Nov 17 '22 02:11

Alessandro Dovis