Error:Unable to start the daemon process. This problem might be caused by incorrect configuration of

2020-02-27 15:54:45 浏览数 (1)

(一)问题说明:在运行demo的时候就报如下错误

代码语言:javascript复制
Error: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 guide chapter on the daemon at http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

(二)分析

将以上错误总结为:Android Studio 中 gradle 构建 堆栈空间不足,所以将其设置小一点即可,一般为1024或者512都可以,自己设置测试为准

(三)解决:

修改工程文件下的gradle.properties文件中的值如下即可

代码语言:javascript复制
org.gradle.jvmargs=-Xmx1024m

0 人点赞