您的位置:首页 > 移动开发 > Android开发

Android Error:Failed to complete Gradle execution.

2017-01-08 22:11 471 查看
Android Studio 从另一台PC 拷贝过来的项目,导入出错。纠结了两天~ -_-!



错误代码如下:

Error:Failed to complete Gradle execution.

Cause:
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.10/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


因为每台PC 上的 AS 配置不同,可能会导致出现上面的情况。

而我这里的原因是,在gradle.properties 文件里 JVM 配置出错。

(相对于拷贝项目的AS配置 (╯▽╰)~ )

org.gradle.jvmargs=-Xmx1536m


所以,找到原因,解决就好办了,

1. 注释或删除这行就好了~ (使用默认配置)
2. 修改成: org.gradle.jvmargs=-Xmx512m


(最后别忘了, 要 Clean Project 哦~)

上图:





备注:每个人遇到此类 问题的解决方法不尽相同,这里仅作为参考使用~

若问题未解决,请参考(写的比较详细):

http://www.myexception.cn/ai/1931604.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐