0
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. But it was return always 1(UPDATE_NOT_AVAILABLE). What is the problem this code? And if I use update internal test update, it can't usable this code?

oseach
  • 1

1 Answers1

0

I had the same issue, nothing worked until I cleared the cach and data for playstore app. as mentioned in Mehul Kabaria answer in the below thread

In App Update API always returns 1 (UPDATE_NOT_AVAILABLE)