您的位置:首页 > 移动开发 > Objective-C

构建工具----gradle---可能遇到的问题----Could not reserve enough space for object heap

2017-01-24 18:08 1991 查看
Could not reserve enough space for object heap

意思是 jvm的设置内存不足以运行gradle命令了。

分为两种情况,解决的方法也不同。

cmd命令行中使用gradle的错误

在命令行中使用gradle命令时可能会报如下错误:

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.10/userguide/gradle_daemon.html
Please read below 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.



解决方法:

1 定位到目录 C:\Users\<username>\.gradle 例如我这里是C:\Users\zoe\.gradle

2 创建文件gradle.properties 内容:org.gradle.jvmargs=-Xmx512m

再执行命令发现不再报错了,运行成功。





myeclipse或者Android Studio中使用gradle报错

这种情况如果使用情况一中的解决方式不能解决的话,可以尝试设置IDE中的内存配置。

如图 找到 gradle的arguments设置jvm大小 为-Xmx512m

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐