这是一个可怕的错误

Installation failed with message Failed to finalize session : INSTALL_FAILED_USER_RESTRICTED: 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.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

当试图在我的红米4 MIUI 8.5.4.0中运行apk时

启用OEM解锁

解决方案尝试

MIUI优化关闭 打开USB调试 通过打开USB验证应用程序

注意:当通过USB打开安装时,会弹出提示“设备暂时受限”


当前回答

对我来说,以上的方法都没用。相反,我做以下步骤,解决了这个问题:

> Mi解锁状态>添加帐号和设备。(将显示成功消息) 打开USB调试。 打开通过USB安装。

注意:这是在红米MIUI Global 8.5版本上检查的。

这个解决方案将专门解决问题,如果你最近注销了小米账户,并再次登录。

希望它能帮助到一些人。

其他回答

对于MIUI全局13及以上关闭MIUI优化

转到developer选项 按下第一个按钮“重置为默认值” 按5次或以上, 然后关闭MIUI优化是可见的

如果它仍然不工作,尝试添加android:exported="true"和升级你的依赖

If above answer didn't work for you as it didn't work for me on my Xiaomi Mi5.I tried to figure out the Core reason behind it and solve it. In MIUI, in order to change "Install via USB" option, you must be connected to the internet and signed in your Mi account. Due to some reason, requests from out of the China servers are getting rejected, so I connected to one open China VPN and tried again to enable 'Install via USB' and I got success. For detailed solution and VPN details, see this useful Youtube video: https://youtu.be/MeKUJlD-Ke4

首先,检查您的USB debusing选项所有强制性应启用。 然后从设备上卸载应用程序,然后尝试重新安装。 这对我很有用。

对我来说,只有从谷歌驱动器安装才能工作。