通过配置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
配置文件内容: