[RN坑]com.android.ddmlib.InstallException: Failed to establish session以及白屏

问题

环境

windows + 小米3

问题

react-native run-android运行react-native helloworld的时候,跑到:app:installDebug后就报错了

Installing APK 'app-debug.apk' on 'MI 3W - 6.0.1' for app:debug
Unable to install D:\Documents\WebStorm\react-native\AwwsomeProject\android\app\build\outputs\apk\app-debug.apk
com.android.ddmlib.InstallException: Failed to establish session
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:64)
at com.android.ddmlib.Device.installPackages(Device.java:904)
at com.android.builder.testing.ConnectedDevice.installPackages(ConnectedDevice.java:137)
at com.android.build.gradle.internal.tasks.InstallVariantTask.install(InstallVariantTask.java:134)
...
:app:installDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6 mins 22.498 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

balabala一大堆

解决办法

[开发者选项]中 关闭 [弃用MIUI优化],白屏的话它自动提示我开启[悬浮窗权限],然后摇一摇reload一下就好了

参考文档

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容