gradle.properties的配置

通过配置gradle.properties中的参数,可以调整编译时堆栈的大小。尤其对一些方法数比较多的工程,打开了multidex编译开关,在编译时一定要配置较大的heap,否则会出现如下提示甚至OOM错误。

To run dex in process, the Gradle daemon needs a larger heap.

It currently has 959 MB.

For faster builds, increase the maximum heap size for the Gradle daemon to at least 1536 MB.

To do this set org.gradle.jvmargs=-Xmx1536M in the project gradle.properties.

For more information see https://docs.gradle.org/current/userguide/build_environment.html


配置文件内容:

org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

org.gradle.parallel=true

org.gradle.daemon=true

你可能感兴趣的:(gradle.properties的配置)