Android(安卓)Studio出现Unable to start the daemon process问题


一、问题

在Android Studio中新建的工程出现了以下问题

Error:Unable to start the daemon process.http://write.blog.csdn.net/postedit?ref=toolbarThis 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 https://docs.gradle.org/2.14.1/userguide/gradle_daemon.htmlPlease read the following process output to find out more:-----------------------Error occurred during initialization of VMCould not reserve enough space for 1572864KB object heap

二、分析

根据问题我们分析可以得出:Android Studio中gradle构建堆栈空间不足1572864KB。


三、解决

打开工程目录下的gradle.properties文件


(方法一)

将org.gradle.jvmargs=-Xmx1536m中的值设置小一些,一般为1024或512


(方法二)

将org.gradle.jvmargs=-Xmx1536m前面加上“#”注释掉即可(Gradle的jvm的内存分配设置,注释掉就是使用默认或者系统配置。)