Android Studio Gradle Could not reserve enough space for object heap

Studio 创建第一个工程报错

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 https://docs.gradle.org/4.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 1572864KB object heap

解决办法:http://blog.csdn.net/u014581901/article/details/51628798

在用AndroidStudio时出现这样的错误: 
这里写图片描述 
搞了半天终于找到了解决办法,但是很麻烦。就是每次创建工程后,在gradle.properties文件中加入如下代码: 
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m 
这里写图片描述
然后重启工程就好了,如果想彻底解决此问题,还是觉得应该从新安装最新版的AdroidStudio.不知为什么AS老是无缘无故报各种错误,真是太烦了。

原文地址:https://www.cnblogs.com/summary-2017/p/8074801.html