在调试设备上测试时显示UPDATE_NOT_AVAILABLE的应用内更新API [英] In-App Update API showing UPDATE_NOT_AVAILABLE while testing on debugging device

查看:474
本文介绍了在调试设备上测试时显示UPDATE_NOT_AVAILABLE的应用内更新API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试集成新的应用内更新API,但无法测试其实现.似乎我的代码很好,因此我阅读了问题排查并且无法理解本文档中的两点内容

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 able to understand 2 points in this document

请确保您要测试的应用使用与Google Play可用的签名密钥相同的签名密钥进行签名.

Make sure that the app that you are testing is signed with the same signing key as the one available from Google Play.

  1. 在已连接设备上安装Apk时,如何在调试模式下使用相同的签名密钥进行签名?

如果您要测试的应用没有显示可用更新, 检查您是否已正确设置测试轨道.

If the app you are testing doesn’t appear with an available update, check that you’ve properly set up your testing tracks.

  1. 是否必须在内部测试轨道上发布App来测试实施?

无论如何,我只想在设备上进行测试,并且从Play商店版本中减少了版本代码,但始终显示为UPDATE_NOT_AVAILABLE.

Anyway I just want to test on my device and I decremented the version code from the play store version but its showing always UPDATE_NOT_AVAILABLE.

这是代码:-

val appUpdateInfo: Task<AppUpdateInfo> = appUpdateManager.appUpdateInfo
appUpdateInfo.addOnSuccessListener {
    if (it.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE && it.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
        appUpdateManager.startUpdateFlowForResult(it, AppUpdateType.FLEXIBLE, this, 2);
    }else{
        toast("Not Available")
    }
}

推荐答案

我为同一天的问题苦苦挣扎了几天,然后才再次彻底阅读文档.正式阅读本节应用内更新的文档.

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. 在测试设备上,确保已安装满足以下要求的应用程序版本:

  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

按照Play控制台说明如何在内部共享您的应用.确保您上传的应用程序版本使用的版本代码高于测试设备上已安装的版本代码.

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.

这也非常有用,因为您不必等待应用程序发布,就可以立即开始测试.

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

这篇关于在调试设备上测试时显示UPDATE_NOT_AVAILABLE的应用内更新API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆