升级Android Studio和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/1.12/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.
解决思路有3步:
第一步
很有可能是开启了太多的其他进程,导致Gradle无法获取足够的空间
File-Invalidate Cache / Restart
如果上面这步不管用请试试第二步
Configure -> Settings -> Gradle
Gradle VM Options 项 设置为:-Xmx512m
第三步
在gradle的安装根路径下添加gradle.properties文件, 文件中的内容如下:
org.gradle.jvmargs=-Xmx512m
注意:gradle的安装根路径一般在C盘/用户下