简体   繁体   English

android AppUpdateInfo.updateAvailability 总是返回 1

[英]android AppUpdateInfo.updateAvailability always return 1

private fun checkRecentVersion() {
    val appUpdateManager = AppUpdateManagerFactory.create(this)
    val appUpdateInfoTask = appUpdateManager.appUpdateInfo

    appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
        if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE) {
            setView(false, updateAvailability = appUpdateInfo.updateAvailability())
        } else {
            setView(true, updateAvailability = appUpdateInfo.updateAvailability())
        }
    }.addOnFailureListener {
        setView(true, true, -100)
    }
}

I check this code update my app upload in internal test.我在内部测试中检查此代码更新我的应用程序上传。 I want to update check use appUpdateManager.我想更新检查使用 appUpdateManager。 But it was return always 1(UPDATE_NOT_AVAILABLE).但它总是返回 1(UPDATE_NOT_AVAILABLE)。 What is the problem this code?这段代码有什么问题? And if I use update internal test update, it can't usable this code?如果我使用更新内部测试更新,它不能使用此代码?

I had the same issue, nothing worked until I cleared the cach and data for playstore app.我遇到了同样的问题,在我清除 Playstore 应用程序的缓存和数据之前,没有任何效果。 as mentioned in Mehul Kabaria answer in the below thread如以下线程中的 Mehul Kabaria 回答所述

In App Update API always returns 1 (UPDATE_NOT_AVAILABLE) 在 App Update API 中总是返回 1 (UPDATE_NOT_AVAILABLE)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM