AS Error:Unable to start the daemon process: could not reserve enough space for object heap

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/generallizhong/article/details/54288476

对AS还不是辣么的熟悉,使用过程中也和大家一样遇到了许多的问题,下面这个问题就是导入了一个demo出现的:

第一个问题:

Error:Unable to start the daemon process: could not reserve enough space for object heap.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
Read Gradle's configuration guide
Read about Java's heap size

刚开始还是在网上看了很多解决办法都不行。

最后试了下面这种办法:

修改项目(没有就添加)gradle.properties文件,添加下面一行代码:

org.gradle.jvmargs=-Xmx512m-XX:MaxPermSize=512m

第二个问题:

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对项目进行配置的,而系统中没有对Android Studio的默认配置,就像eclipse中的eclipse.ini文件一样的。

我的解决办法:

在当前操作系统用户下的.gradle文件下:C:\Users\Administrator\.gradle 设置gradle.properties,如果没有就新建增加。

org.gradle.jvmargs=-Xmx512m  

然后就正常了

遇到有些问题,别人给出的解决办法不一定就能解决到自己问题,具体解决办法还是要静下心来分析问题情况找到原因才是最好的解决办法。


猜你喜欢

转载自blog.csdn.net/generallizhong/article/details/54288476