2016-11-24 73 views
0

我已經開始在android studio 2新版本的新項目。然後「錯誤:無法啓動守護進程」。這些線顯示出來。 然後我加入這行在Android工作室重複的gradle屬性錯誤

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 
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 

我怎樣才能永久安裝的搖籃屬性,以每避免這種時間。

+0

你有多少內存?你使用gradle-wrapper還是本地分發? –

回答

0

打開位於androidStudio/bin/studio.vmoptions

它應該是這樣的文件,如果沒有相應的

# 
# *DO NOT* modify this file directly. If there is a value that you would like to override, 
# please add it to your user specific configuration file. 
# 
# See http://tools.android.com/tech-docs/configuration 
# 
-Xms256m 
-Xmx1280m 
-XX:MaxPermSize=350m 
-XX:ReservedCodeCacheSize=240m 
-XX:+UseConcMarkSweepGC 
-XX:SoftRefLRUPolicyMSPerMB=50 
-da 
....... 

改變它,這個最有可能解決您的問題。

+0

@Max不能正常工作 –

0

Could not reserve enough space for 1572864KB object heap

此消息建議gradle仍然沒有足夠的內存空間。如果你有4GB的RAM或更多,設法增加其在gradle.properties,如:

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

如果故障仍存在,試圖刪除.gradle目錄(C:\用戶\ your_username \ .gradle),然後無效緩存和重新啓動Android Studio。

+0

不能正常工作這兩個步驟 –

+0

您可以顯示'gradle.properties'和'studio.exe.vmoptions'的內容嗎? –