問題
環(huán)境
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一大堆
解決辦法
[開發(fā)者選項]中 關(guān)閉 [棄用MIUI優(yōu)化],白屏的話它自動提示我開啟[懸浮窗權(quán)限],然后搖一搖reload一下就好了