yoo*_*hok 3 android google-play in-app-update google-play-core
Google I/O 2019 新增应用内更新。
所以我尝试按照文档使用它:https ://developer.android.com/guide/app-bundle/in-app-updates
但它发送了一个 InstallException,如下所示:
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)
Run Code Online (Sandbox Code Playgroud)
我的代码在这里:
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!")
}
}
Run Code Online (Sandbox Code Playgroud)
我知道,它是今天才发布的。但有人知道这个吗?
| 归档时间: |
|
| 查看次数: |
3027 次 |
| 最近记录: |