天天看點

安卓運作時異常:Error:Unable to start the daemon process

(一)問題說明:在運作demo的時候就報如下錯誤

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 建構 堆棧空間不足,是以将其設定小一點即可,一般為1024或者512都可以,自己設定測試為準

(三)解決:

修改工程檔案下的gradle.properties檔案中的值如下即可

org.gradle.jvmargs=-Xmx1024m           

複制