无法同步 Gradle 项目 [英] Failed to sync Gradle project
问题描述
我正在使用 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=-Xmx2048
和 MaxPermSize=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?
推荐答案
方法一:
对于 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
方法二:
第 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 步:将构建过程堆大小(Mbytes)更改为 1024,将 VM 选项的附加构建过程更改为 -Xmx512m.
第 5 步:关闭或重启 Android Studio.
这篇关于无法同步 Gradle 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!