In-App Update gives InstallException (ERROR_API_NOT_AVAILABLE)

前端 未结 7 865
野性不改
野性不改 2021-02-01 23:04

Implemented in-app update feature, using the following code snippet:

private void showInAppUpdateDialog(boolean isMandat         


        
7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 23:32

    On top of what Vipal suggested, the issue may be due to a signature mismatch between the version you have installed on the device and the one that Play Store would deliver (this is a common issue if you try to test it with debug builds). See https://developer.android.com/guide/playcore/in-app-updates#troubleshoot

    Recently the Play Core API started returning an API_NOT_AVAILABLE error if the app is not owned by the user or the signatures mismatch, while before it used to return a successful UPDATE_NOT_AVAILABLE Task.

    The recommendation is:

    • if you use the Kotlin Extension, make sure that you are catching the exception thrown by requestAppUpdateInfo
    • if you use PlayCore Java, make sure you have an onFailureListener that handles failures from getAppUpdateInfo
    • in order to test a debug build, you can use Internal App Sharing, as explained here: https://developer.android.com/guide/playcore/in-app-updates#internal-app-sharing

    Source: I work on the Play Core team

提交回复
热议问题