Android, InstallException occurs when I use in-app updates(Android,当我使用应用内更新时发生 InstallException)
问题描述
在 Google I/O 2019 中,新增了应用内更新.
In Google I/O 2019, In-app update is added newly.
所以我尝试按照文档使用它:https://developer.android.com/guide/app-bundle/in-app-updates
So I am trying to use it following the document: https://developer.android.com/guide/app-bundle/in-app-updates
但它发送了一个类似的 InstallException:
But it sent an InstallException like:
com.google.android.play.core.tasks.RuntimeExecutionException: com.google.android.play.core.install.InstallException: Install Error: -6
at com.google.android.play.core.tasks.k.getResult(Unknown Source:18)
at com.eastriver.workingtimer.ui.MainActivity$onCreate$1.onComplete(MainActivity.kt:35)
我的代码在这里:
val appUpdateManager = AppUpdateManagerFactory.create(this)
val appUpdateInfo = appUpdateManager.appUpdateInfo
appUpdateInfo.addOnCompleteListener {
val result = it.result
if (result.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
&& result.isUpdateTypeAllowed(AppUpdateType.FLEXIBLE)) {
info("should show update")
appUpdateManager.startUpdateFlowForResult(
result,
AppUpdateType.FLEXIBLE,
this,
1)
} else {
info("This is already latest version!")
}
}
我知道,它就在今天发布.但是有人知道吗?
I know, it is released just nowadays. But somebody knows this?
推荐答案
错误代码记录在 javadoc.
这说:
int ERROR_INSTALL_NOT_ALLOWED
int ERROR_INSTALL_NOT_ALLOWED
由于当前设备状态(例如低电池,磁盘空间不足,...).
The download/install is not allowed, due to the current device state (e.g. low battery, low disk space, ...).
常数值:-6 (0xfffffffa)
Constant Value: -6 (0xfffffffa)
所以我怀疑您的设备没有空间或没有插入电源,并且此设备上的更新首选项需要电源和 WiFi.
So I suspect your device either does not have space or is not plugged in to power, and the update preferences on this device require power and WiFi.
这篇关于Android,当我使用应用内更新时发生 InstallException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android,当我使用应用内更新时发生 InstallException


- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- UITextView 内容插图 2022-01-01
- URL编码Swift iOS 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01