无法启动模拟器.原因:当react-native run-android时,模拟器在启动前退出 [英] Failed to launch emulator. Reason: Emulator exited before boot en React Native when react-native run-android
问题描述
我正在根据此网站 https://medium.com/@leonardobrunolima/react-native-tips-setting-up-your-development-environment-for-windows-d326635604ea ,它在我运行之前非常有用命令 react-native run-android
,这是我收到的错误
I am installing React Native according to this website https://medium.com/@leonardobrunolima/react-native-tips-setting-up-your-development-environment-for-windows-d326635604ea, it's very useful until I run the command react-native run-android
, this is the error I receive
info运行jetifier将库迁移到AndroidX.您可以使用"--no-jetifier"将其禁用旗帜.Jetifier发现有864个文件需要正向喷射.使用8名工人...信息正在启动JS服务器...信息正在启动模拟器...错误无法启动模拟器.原因:模拟器在启动前退出..
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 864 file(s) to forward-jetify. Using 8 workers... info Starting JS server... info Launching emulator... error Failed to launch emulator. Reason: Emulator exited before boot..
任务:app:transformNativeLibsWithMergeJniLibsForDebug失败
Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED
在此版本中使用了不推荐使用的Gradle功能,使其与Gradle 6.0不兼容.使用"--warning-mode all"显示各个弃用警告.请参见 https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 24个可执行任务:已执行4个,最新20个
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 24 actionable tasks: 4 executed, 20 up-to-date
失败:构建失败,并出现异常.
FAILURE: Build failed with an exception.
- 出了什么问题:任务':app:transformNativeLibsWithMergeJniLibsForDebug'的执行失败.
无法读取路径'C:\ JesusApp \ android \ app \ build \ intermediates \ transforms \ mergeJniLibs \ debug \ 0 \ lib \ x86_64'.
Could not read path 'C:\JesusApp\android\app\build\intermediates\transforms\mergeJniLibs\debug\0\lib\x86_64'.
-
尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出.与--scan一起运行以获得完整的见解.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
在7秒内失败
错误无法安装该应用程序.确保您已设置Android开发环境: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment .使用--verbose标志运行CLI以获取更多详细信息.错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort = 8081
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
失败:构建失败,并出现异常.
FAILURE: Build failed with an exception.
- 出了什么问题:任务':app:transformNativeLibsWithMergeJniLibsForDebug'的执行失败.
无法读取路径'C:\ JesusApp \ android \ app \ build \ intermediates \ transforms \ mergeJniLibs \ debug \ 0 \ lib \ x86_64'.
Could not read path 'C:\JesusApp\android\app\build\intermediates\transforms\mergeJniLibs\debug\0\lib\x86_64'.
-
尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出.与--scan一起运行以获得完整的见解.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
在7秒内失败
at checkExecSyncError (child_process.js:629:11) at execFileSync (child_process.js:647:13) at runOnAllDevices (C:\JesusApp\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39) at process._tickCallback (internal/process/next_tick.js:68:7)
我的节点版本是10,并且我正在Windows上工作,请帮助,谢谢.
My node version is 10, and I am working on Windows, please help, thank you.
推荐答案
首先在Android Studio上启动android仿真器,然后执行react-native run-android.如果不起作用,请转到android studio并执行构建->清理项目"
First start the android emulator on Android Studio, then execute the react-native run-android. If it doesn´t work go to android studio and do "Build -> Clean Project"
这篇关于无法启动模拟器.原因:当react-native run-android时,模拟器在启动前退出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!