MIUI系统(MIUI8.0&&MIUI9.0)在Android Studio 运行出错集及其解决方案

最近用一台红米 4 高配版来做测试机,它是小米 MIUI 系统的最新版本 MIUI8,我的 AS 是 2.3 版本,在网上查看了相关问题,在小米 5 和红米 note4x 等配备了 MIUI8 系统的手机都遇到了相同的问题,所以我相信大家第一次用 MIUI8 系统手机来测试肯定也会遇到这些问题。下面来列举自己在开发中使用 MIUI8 遇到的坑,也希望可以帮助大家快速解决问题。


1.Installation failed with message INSTALL_CANCELED_BY_USER.
   It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.


原因:开发者选项中没有打开 USB 安装。

解决方案:

打开手机的开发者选项(怎么打开自己百度),然后找到 “USB 安装”,设置为开启状态。



2.Installation failed with message Failed to establish session

原因:没有在开发者选项中关闭 MIUI 优化

解决方法:

开发者选项 -> 启动 MIUI 优化  取消打开




3.installation failed with message failed to finalize session:INSTALL_FAILED_INVALID_APK


原因:出现这个问题的背景是当我经历完问题 1 之后,我可以成功安装程序,但是在我修改了代码之后重新安装,直接弹窗,当我点击 OK,直接报错,安装失败。

解决方案:

File->Setting->Build->Instant Run



转自:https://blog.csdn.net/ljcitworld/article/details/69948354

最近用一台红米 4 高配版来做测试机,它是小米 MIUI 系统的最新版本 MIUI8,我的 AS 是 2.3 版本,在网上查看了相关问题,在小米 5 和红米 note4x 等配备了 MIUI8 系统的手机都遇到了相同的问题,所以我相信大家第一次用 MIUI8 系统手机来测试肯定也会遇到这些问题。下面来列举自己在开发中使用 MIUI8 遇到的坑,也希望可以帮助大家快速解决问题。


1.Installation failed with message INSTALL_CANCELED_BY_USER.
   It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.


原因:开发者选项中没有打开 USB 安装。

解决方案:

打开手机的开发者选项(怎么打开自己百度),然后找到 “USB 安装”,设置为开启状态。



2.Installation failed with message Failed to establish session

原因:没有在开发者选项中关闭 MIUI 优化

解决方法:

开发者选项 -> 启动 MIUI 优化  取消打开




3.installation failed with message failed to finalize session:INSTALL_FAILED_INVALID_APK


原因:出现这个问题的背景是当我经历完问题 1 之后,我可以成功安装程序,但是在我修改了代码之后重新安装,直接弹窗,当我点击 OK,直接报错,安装失败。

解决方案:

File->Setting->Build->Instant Run



转自:https://blog.csdn.net/ljcitworld/article/details/69948354

猜你喜欢

转载自blog.csdn.net/qq_33945246/article/details/79908030
今日推荐