Android Studio创建新项目错误

0 投票
最新提问 2月 20 分类:Android | 用户: 花花 (390 分)
重新分类 2月 21 用户:bczs

我使用Android Studio创建过很多项目没有发生过错误,但是今天不知道什么原因,当创建一个新的项目时一直提示以下错误

`Gradle 'MyApplication' project refresh failed
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/2.14.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

这是什么原因导致的?

1个回答

0 投票
最新回答 2月 21 用户: 任我笑 (140 分)

您遇到以下错误:

Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap

这意味着JVM没有足够的内存空间。在gradle.properties文件中添加以下属性将解决您的问题:

org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
Where to put it

欢迎来到编程助手,编程方面有什么不懂的问题可以尽管在这里提问,你将会收到热心爱好者的回答。
...