In-App Update API showing UPDATE_NOT_AVAILABLE while testing on debugging device

后端 未结 12 895
攒了一身酷
攒了一身酷 2020-12-29 12:22

I am trying to integrate the new In-App Update API but I cannot able to test it\'s implementation. Seems like my code is fine therefore I read the Troubleshoots and am not a

相关标签:
12条回答
  • 2020-12-29 13:01

    As of today, in-app-update testing can not be done for a debug build. You don't need to put your apk to PlayStore to test also. The best way to test in-app-update is by using internal-app-sharing.

    If you follow the below steps one-by-one, you'll be able to test successfully.

    1. To test the app, a tester has to first enable Internal-App-Sharing in PlayStore, follow this link for the same, How to Enable Internal App Sharing for Android?
    2. If you're brave enough to understand the official documents, then simply follow this link to set-up in-app-update testing in your device, https://developer.android.com/guide/playcore/in-app-updates#internal-app-sharing

    Here, I'll be writing the same in easy words.

    Once you're done with setting up internal-app-sharing in Play-Store, make sure that you have to upload 2 apks to internal-app-sharing on Play-Console and hence generate 2 links. Both apks will be signed using the same signing-key (need not be the same as the one you use to sign for production, any dummy signing-key would work).

    1. First you upload an apk with in-app-update implementation with lower VersionCode (say, 100) to internal-app-sharing on play console.

    To know, How to upload apk to internal-app-sharing on Play-Console, follow this lisk, https://support.google.com/googleplay/android-developer/answer/9844679?visit_id=637437125318137239-1277036129&rd=1

    NOTE: make sure, you have uninstalled any preinstalled app with the same package-name in your device.

    1. Now you copy the link of the app you uploaded to internal-app-sharing on the play console and use this link to install the app on your device.

    NOTE: Before installing, make sure the email-id you're using on play-store has been added in the mail-list on internal-app-sharing on play-console.

    1. Now, once you've installed the app using the link. Now, you need to again create a new signed apk with higher VersionCode (say, 101). And upload this apk to internal-app-sharing.

    2. Now, copy the link with higher VersionCode from internal-app-sharing. Click on this link on your device, it will take you to play-store but this time, update button will be enabled rather than install button as app is already installed in your device with lower VersionCode.

    3. You don't have to click the update button on PlayStore. You just have to click the link and hence open the screen on PlayStore. Now close PlayStore app.

    4. Now, you can launch the already installed app from your device.

    If your implementation of in-app-update is fine, launching the app would appear the dialog from PlayStore for update.

    0 讨论(0)
  • 2020-12-29 13:02

    Also there is FakeAppUpdateManager that was created for such purposes. You can use it.

    0 讨论(0)
  • 2020-12-29 13:04

    I struggled with this same problem for a few days before once again going through the documentation thoroughly. Read this section on the official documentation of the in-app updates.

    The link describes the correct testing procedure as follows:

    1. On your test device, make sure you've already installed a version of your app that meets the following requirements:

      • The app was installed using an internal app sharing URL
      • Supports in-app updates
      • Uses a version code that's lower than the updated version of your app
    2. Follow the Play Console instructions on how to share your app internally. Make sure you upload a version of your app that uses a version code that's higher than the one you have already installed on the test device.

    3. On the test device, only click the internal app-sharing link for the updated version of your app. Do not install the app from the Google Play Store page you see after clicking the link.
    4. Open the app from the device's app drawer or home screen. The update should now be available to your app, and you can test your implementation of in-app updates.

    This is also super helpful because you don't have to wait for the app to be published, you can start testing immediately.

    0 讨论(0)
  • 2020-12-29 13:07

    Basic Requirements for Manual Testing

    In order to manually perform the full update flow on the test device, you should have at least two versions of the app with the different version number: a source version and a target version.

    • The source version with the higher version number should be published at Google Play, this is the version which will be identified by Google Play as an available update. The target version with the lower version number and integrated IAUs(In-App Updates) feature should be installed on your device, this is the version which will be updated. The thing is, when the app requests Google Play to check for available updates, it compares the version number of the installed app with the version number of the last available build-in Google Play. So the IAUs feature will be triggered only in case if the version number in Google Play is higher than actual version of the app on the device.
    • Both the source and the target versions need to have the same package name and should be signed with the same release certificate.
    • Android 5.0 (API level 21) or higher.
    • Play Core library 1.5.0 or higher.

    Update is Not Available ERROR

    First of all, please double-check the requirements mentioned above. If you successfully complete above listed steps in compliance with all requirements and still getting the error then please pay attention to the following trick. The most likely reason is that the Google Play app does not know about the update yet due to the internal caching mechanism. To make sure you have the cache fresh when testing manually you can refresh the cached version by going to the My Apps & Games screen in the Google Play app. Other, alternative, you can simply clear the cache of the Google Play app in the settings. Note that this is just an issue for testing and does not affect end users since the cache is updated daily anyway.

    Note - App Bundle is not mandatory for IAUs.

    0 讨论(0)
  • 2020-12-29 13:07

    You got a wait after publishing, it takes 2 to 6 hours.

    0 讨论(0)
  • 2020-12-29 13:10

    Finally resolved this by removing the app from Play Store -> My apps & games -> Library.

    • You must install release application with same keystore that you used for previous version.

    This happens when you have previously installed the same app with higher version code on your device or any device which shares the same gmail address in Play Store. Hope this helps.

    0 讨论(0)
提交回复
热议问题