android - 在 Android 中使用应用内更新时如何解决安装状态码 -100?
问题描述
我正在从这里使用应用内更新: https ://developer.android.com/guide/app-bundle/in-app-updates
我已经在我的应用程序中成功实现了它。我的应用程序已经在 Playstore 中: https ://play.google.com/store/apps/details?id=com.tekitsolution.remindly
为了测试这个实现,我在我的项目中减少了版本,并在 Splash Activity 中实现了。
所以,我得到了更新屏幕,我点击更新并开始下载。完成下载后,它再次来到同一页面下载并且installErrorCode
得到-100,这意味着Play商店发生内部错误。(有没有办法理解安装错误代码的实际含义?)
Flow from update screen:
I printed logs for `state.installStatus()`
PENDING = 1;
DOWNLOADING = 2;
DOWNLOADED = 11;
INSTALLING = 3;
然后代替这个(INSTALLED = 4),我用 state.installErrorCode -100 得到 FAILED = 5
代码:
private InstallStateUpdatedListener installStateUpdatedListener = new
InstallStateUpdatedListener() {
@Override
public void onStateUpdate(InstallState state) {
showLog("In-App: " + state.installStatus());
showLog("installErrorCode " + state.installErrorCode());
if (state.installStatus() == InstallStatus.DOWNLOADED) {
popupSnackbarForCompleteUpdate();
} else if (state.installStatus() == InstallStatus.INSTALLED) {
if (mAppUpdateManager != null) {
showLog("In-App: unregisterListener");
mAppUpdateManager.unregisterListener(installStateUpdatedListener);}
}
}
};
注意:我也尝试过使用不同的设备。
解决方案
推荐阅读
- java - 基于单元格值将工作簿拆分为多个工作簿的 Java 代码
- node.js - 如何确定机器人和用户是否在同一台服务器上?
- sql - 如何搜索某个国家/地区某个地区的餐厅?
- javascript - JavaScript PopUp 仅在 ASP.NET 中的每个用户的页面上出现一次
- amazon-web-services - 在不使用 Python 脚本的情况下关闭 AWS Sagemaker
- sql-server - ASP.Net Core Identity EF 5.0 仅将用户还原到数据库
- python - 如何获得当月的第一天?
- javascript - 使用websocket时如何从客户端追踪互联网连接?
- python-3.x - python中的导入错误,当模块有导入时
- python - 对列表中的元素进行子切片