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

后端 未结 12 894
攒了一身酷
攒了一身酷 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 12:50

    I installed my app from Google Play. Then I removed it and intalled the signed apk with lower versionCode.

    "In-app updates are available only to user accounts that own the app. So, make sure the account you’re using has downloaded your app from Google Play at least once before using the account to test in-app updates." developer.android.com/guide/app-bundle/in-app-updates

    0 讨论(0)
  • 2020-12-29 12:55

    First, you'd have to publish your app to Google Play. Make sure that:

    1. The version code you published is higher than the one you're going to test the updates with, because if not, then it wouldn't recognize it as an update. Then let the Google Play refresh its cache for quite some time (in my case, I've waited for 12 hours before I was able to make it work for the first time).
    2. You've signed both apks with the same signature.

    If you want to have a working demo app, I've uploaded a git repository with a lower version code than the one that I've published in Google Play.

    0 讨论(0)
  • 2020-12-29 12:55

    When Internal app sharing dont work

    Internal App Sharing is not working on a real device. I was testing several hours and always got the latest version of Internal Test and not the one of Interal App Sharing that was what I expected.

    The solution is to use an emulator with Play Store.

    I describe the step by step:

    1. Create Virtual Device with Google Play greater than or equal to API Level 21 5.0.
    2. Open the emulator and log in with the google account that is in the list of internal testers.
    3. Build the 2 APKs with different versions. Each one with the same versionCode and versionName temporarily to go checking when performing the installations. For example:

    APK 1: versionCode and versionName: 100
    
    APK 2: versionCode and versionName: 101
    

    1. Upload APK 1 to internalappsharing with versionCode and versionName 100

    2. Copy and paste the shared link of APK 1 into Keep Notes web app.

    3. Install APK 1 with versionCode 100 using the link from the emulator Keep Notes application.
    4. The most important thing: Check that the installed app has versionName 100.
    5. If we open APK 1 at this point, no update will be available until we upload APK 2 with a larger version.
    6. Upload APK 2 with code 101 to internalappsharing
    7. Copy and paste the APK 2 link into Keep Notes web app.
    8. DO NOT install APK 2 from the link. Just enter APK 2 link to check that the Play Store describes the existence of an update.
    9. Open the app installed on the emulator with APK 1 and install the update in-app.

    Finally, each time they enter a link with a version code greater than the last installed from the emulator they will see the existence of a new update, which should be installed within the app and not from the Play Store.


    It is worth mentioning that Logcat is compatible with Internal App Sharing.

    GL

    Source

    0 讨论(0)
  • 2020-12-29 12:56

    As Arpit J. suggested basic main requirements to test the app, if still you are not able to successfully test the app, I would like to add one more last step that would help you to quickly test the app.

    Go to play store app info from settings as shown in image, and do clear data as show in attached screenshots. The steps to go to play store app info may vary device by device.

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

    I had the similar issue of having UPDATE_NOT_AVAILABLE. After hours of researching, here is how i solved:

    1. use Google play store to install a version of the testing app (I used internal test track rollout)

    2. rollout another version with higher VERSION CODE on Play Console (the same internal test track)

    3. close both testing app and Google play store (not just back to home, use recent key and swipe them off)

    4. open the Google play store and ensure that testing app has an update available (you can check it under "My Apps & Game" > Installed)

    5. now open the testing app and check for UPDATE_AVAILABLE

    This works for me almost immediately after rollout

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

    For the first question, they are saying that you need to do a release build of the app, using your release keystore. Then, you could attach the resulting .apk file to an e-mail and e-mail it to yourself. Then, check your e-mail on your android device and download the .apk attachment to your downloads, and at the end of the download, Android should ask if you want to install the .apk, say yes (if it doesn't ask, then click on the file in your downloads folder, and then it should ask).

    For the second question, the only way I can imagine testing this through the internal testing tracks since you have to interact with the Google Play storefront, but not affect your live published release.

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