react-native - react-native run-android 命令失败,错误:无法处理守护进程
问题描述
我被这个错误困扰了很长时间,当我尝试点击 react-native run-android 时,我的构建失败了,下面是错误:
react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 2263 file(s) to forward-jetify. Using 4 workers...
info Starting JS server...
info Installing the app...
Starting a Gradle Daemon, 52 busy Daemons could not be reused, use --status for details
Starting a Gradle Daemon, 53 busy Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.8/userguide/gradle_daemon.html
Process command line: C:\Program Files\OpenJDK\openjdk-8u282-b08\bin\java.exe -Xmx4096m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Parentlane\.gradle\wrapper\dists\gradle-6.8-bin\1jblhjyydfkclfzx1agp92nyl\gradle-6.8\lib\gradle-launcher-6.8.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.8
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Unable to allocate 131072KB bitmaps for parallel garbage collection for the requested 4194304KB heap.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
* 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.
* Get more help at https://help.gradle.org
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
卡了好久,不知道怎么解决,求大神帮忙
解决方案
推荐阅读
- angularjs - 如何在模式中设置自定义单选按钮的默认值
- javascript - 带有 $match 的聚合查询在 MongoDB Compass 中有效,但在我的 Node.js 应用程序中无效
- java - 将新数组分配给现有数组的正确方法
- html - 为什么当我弯曲父容器时 Chrome 会挤压我的文本?
- python - 如何消除负值并计算正整数的总和?
- mysql - 如何使用 mysql 根据同一张表的其他两列填充一列?
- r - R函数根据单位值分配固定资源
- ssrs-2012 - SSRS 父组重复创建“楼梯”
- go - 接口类型和值可以是不实现接口及其值的类型吗?
- java - 即使文件存在并且在同一目录中,Java FileNotFound 错误?我该如何解决?