方法一:
![](https://img-blog.csdnimg.cn/img_convert/8cd474a5bda3b75f101c4c796dc58c5a.png)
![](https://img-blog.csdnimg.cn/img_convert/0abf7cc1cc3a1787e3ceb03fb68a1c24.png)
如果方法一不行用方法二,我出现这问题也是用方法二解决的
方法二:
查找GRADLE_USER_HOME的位置,然后在下面建立一个文本配置,gradle.properties
![](https://img-blog.csdnimg.cn/img_convert/7abfa0b82f9a4e0ff74c87d693942206.png)
建立gradle.properties ,内容为:
org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
![](https://img-blog.csdnimg.cn/img_convert/d617bc9a9d146536aeb035b9ecd1fd22.png)
最后重启就也好