使用应用内更新时`com.google.android.play.core.install.InstallException:安装错误:-6`

Eme*_*kpo 6 android kotlin google-play-services

我正在尝试使用 play-core 库实现应用内更新。我正在使用依赖项

implementation 'com.google.android.play:core:1.5.0'
Run Code Online (Sandbox Code Playgroud)

这是我用来检查更新的代码

val updateManager = AppUpdateManagerFactory.create(this)
        updateManager.appUpdateInfo.addOnSuccessListener {
            //code to run is its successful
        }.addOnFailureListener {
            //something wrong happened
            it.printStackTrace()

        }
Run Code Online (Sandbox Code Playgroud)

Onsuccess在某些设备上被调用,但在某些设备上onFailedListener被调用并抛出此错误 com.google.android.play.core.install.InstallException: Install Error: -6

Man*_*ath 2

在开发人员文档中查看此处 的Install Error: -6含义

由于当前设备状态(例如电池电量低、磁盘空间不足......),不允许下载/安装。

常量值:-6 (0xfffffffa)