Unable to start the daemon process.解决方案

 错误信息如下:

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.5/userguide/gradle_daemon.html
Process command line: D:\Java\jdk-1.8\bin\java.exe -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=CN -Duser.language=zh -Duser.variant -cp C:\Users\DELL\.gradle\wrapper\dists\gradle-6.5-bin\6nifqtx7604sqp1q6g8wikw7p\gradle-6.5\lib\gradle-launcher-6.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.5
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap

-----------------------
Check the JVM arguments defined for the gradle process in:
 - gradle.properties in project root directory

 解决方案如下:

1、修改项目中gradle.properties文件,只要添加以下一行代码:

org.gradle.jvmargs=-Xmx512m

2、重启Android Studio或者点Try again


具体操作如下:

1.打开该项目找到gradle.properties文件,将

org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8用#键注释掉,改成以下代码:
org.gradle.jvmargs=-Xmx512m

 2.点击Try again或者重启Android studio就OK啦~

猜你喜欢

转载自blog.csdn.net/m0_65065082/article/details/130347653