android Studio 采用Grale编译,项目比较多出现了
Error:java.lang.OutOfMemoryError: Java heap space . 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
根据提示找到项目中的
gradle.properties
将这行取消注释 或者添加上
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
试试重新编译项目,有没有搞定,是不是很简单
更多参考:
http://www.mkyong.com/eclipse/eclipse-java-lang-outofmemoryerror-java-heap-space/
http://outofmemory.cn/c/java-outOfMemoryError