Android studio2.2.3从一个计算机复制过来的代码突然就会报错,有时建新的项目也会报错

报错的提示如下:

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




Could not reserve enough space for 1572864KB object heap  这句话告诉我们虚拟机的内存不够用了




解决的办法:第一,发现有时重启一下电脑可以解决这个问题

扫描二维码关注公众号,回复: 2209809 查看本文章

                        第二,在gradle.properties文件里面改一句话



下面的这句话注射起来或者改成   

org.gradle.jvmargs=-Xmx512m



这个问题就可以解决了


完了,clean一下项目,就可以了


亲自测试过,我的bug已经解决


猜你喜欢

转载自blog.csdn.net/android123it/article/details/70314405