应用程序在模拟器上运行正常,但我无法在我的设备上启动应用程序(小米Mi4).首先我用这样的文本播种对话:
Installation failed with message Failed to establish session.
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?
Run Code Online (Sandbox Code Playgroud)
但在我同意之后 - 我在日志中看到这条消息:
Launching app
$ adb install-multiple -r <....>
$ adb shell pm uninstall com.example.app.debug
Unknown failure (Failure - not installed for 0)
Error while Installing APKs
Run Code Online (Sandbox Code Playgroud)
我已经多次重启设备并将其插入/拔出电脑,但没有任何帮助.
小智 60
对于Redmi和Mi设备,请关闭MIUI Optimization并重新启动手机.
设置>其他设置>开发人员选项> MIUI优化
por*_*ion 42
问题在于Instant Run.
正如Chirag Shah所说 - 在小米设备上你可以禁用MIU优化 - 当我尝试时它也适用于我.
另一种解决方案是Instant Run在android studio设置中禁用.我记得 - 我不久前在Windows上遇到过这个问题,但现在它出现在linux(ubuntu)上.我已经向谷歌写了错误报告,但问题仍然存在(第一次是Android studio 2.2.3,现在是2.3).
为方便起见:要禁用"即时运行",请转到
File->Settings->Build, Execution, Deployment->Instant Run
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
32957 次 |
| 最近记录: |