无法同步Gradle项目 [英] Failed to sync Gradle project

查看:172
本文介绍了无法同步Gradle项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Android Studio 1.3.1,但无法同步Gradle项目错误:

I am using Android studio 1.3.1 and getting this failed to sync Gradle project error :

Error:Unable to start the daemon process: could not reserve enough space for
object heap.            
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file,
sets the  maximum Java heap size to 1,024 MB:
org.gradle.jvmargs=-Xmx1024m

我的默认org.gradle.jvmargs=-Xmx2048MaxPermSize=512m仍然向我显示此错误,有人可以告诉我为什么我得到此错误吗?

my default org.gradle.jvmargs=-Xmx2048 and MaxPermSize=512m still it is showing me this error, can anybody tell me why I am getting this error?

推荐答案

方法1:

对于Android Studio 1.3:

For Android Studio 1.3 :

第1步:在Android Studio项目中打开 gradle.properties 文件.

Step 1 : Open gradle.properties file in your Android Studio project.

第2步:在文件末尾添加此行

Step 2 : Add this line at the end of the file

org.gradle.jvmargs=-XX\:MaxHeapSize\=256m -Xmx256m

上面的方法似乎可以工作,但是如果万一不能的话,可以这样做

Above methods seems to work but if in case it won't then do this

方法2:

第1步:启动Android Studio并关闭所有打开的项目(文件>关闭项目).

Step 1 : Start Android studio and close any open project (File > Close Project).

第2步:在欢迎"窗口中,转到配置>设置.

Step 2 : On Welcome window, Go to Configure > Settings.

第3步:转到构建,执行,部署>编译器

第4步:将构建过程堆大小(兆字节)更改为1024 ,并将.

Step 4 : Change Build process heap size (Mbytes) to 1024 and Additional build process to VM Options to -Xmx512m.

第5步:关闭或重新启动Android Studio .

这篇关于无法同步Gradle项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆