安卓运行时异常:Error:Unable to start the daemon process

2022-05-09 10:32:46 浏览数 (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 人点赞