2014-11-06 233 views
1

所以我嘗試了Android Studio(新的android編程,但不是一般的編程),我有點掙扎。在創建我的新項目之後,我馬上收到錯誤消息「Gradle Project Sync Failed。基本功能(例如編輯,調試)將無法正常工作。」Gradle項目同步失敗 - Android Studio 0.8.14

該消息還包括這個搖籃同步消息:

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.1/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. 

我讀過文章後文章(最上SO,谷歌代碼等),有關這個問題,但似乎沒有任何已經工作這麼遠(我猜,因爲幾乎每篇文章都引用了不同的Android Studio版本)。

有沒有人使用我的版本(或接近它的一個)遇到過這個問題?

我正在運行64位Windows 7並安裝了最新的64位JDK版本(截至本文發佈之日)。如果您需要關於我的新項目或設置的任何其他信息,請告訴我。

謝謝大家。

+0

你有多少免費的RAM?嘗試關閉所有其他應用程序並再次同步。 – Ali 2014-11-06 08:40:25

+0

嘗試使用java 7 jdk而不是java 8設置項目。 – MidasLefko 2014-11-11 22:18:19

回答

1

我刪除了位於C:\Users\<username>\gradle\wrapper\dists的整個文件夾,當我重新啓動Android Studio時,它再次下載了整個文件並且它工作正常。

我在這裏做嘗試其他建議,這並沒有爲我工作,但給它一個鏡頭太:

Gradle project sync failed - Android Studio 0.8.14

0

我有同樣的問題,在谷歌搜索時找到這裏。但是,Saurabh的回答對我並不適用。我在網上發現了另一個答案,它的工作。

如何修復這個錯誤:你必須創建此作爲環境變量:變量:_JAVA_OPTIONS值:-Xmx512M

windows下CMD

setx _JAVA_OPTIONS -Xmx512M 

linux下的終端

export _JAVA_OPTIONS=-Xmx512M 

參考鏈接: https://programmierung-dresden.de/category/android/

希望它可以幫助其他人得到同樣的問題。

相關問題