Error while implementing Android In-App Update

Viewed 555

I have implemented below code into my application but there is error while calling InAppUpdate code.

fun checkforUpdate() {
  appUpdateManager = AppUpdateManagerFactory.create(this)
    appUpdateInfoTask = appUpdateManager?.getAppUpdateInfo()

            appUpdateInfoTask?.addOnSuccessListener { appUpdateInfo: AppUpdateInfo ->
                if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE // For a flexible update, use AppUpdateType.FLEXIBLE
                        && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) { // Request the update.
                    try {
                        appUpdateManager?.startUpdateFlowForResult( // Pass the intent that is returned by 'getAppUpdateInfo()'.
                                appUpdateInfo,  // Or 'AppUpdateType.FLEXIBLE' for flexible updates.
                                AppUpdateType.IMMEDIATE,  // The current activity making the update request.
                                this,  // Include a request code to later monitor this update request.
                                REQUEST_UPDATE_CODE)
                    } catch (e: SendIntentException) {
                        e.printStackTrace()
                    }
                }
            }
        }

Error raise while calling the InAppUpdate module:

W/Finsky: [45065] ojr.a(2): No cached information about app applicationame, while trying to retrieve app details.
E/Finsky: [45065] oic.run(7): In-app-update: Missing AppDetails!
0 Answers
Related