Android: Decrease Gradle Build Time By 60%+
1 min readFeb 11, 2017
As stated in the following article:
Get Nir Barzilay’s stories in your inbox
Join Medium for free to get updates from this writer.
The Gradle build time can be decreased significantly. The most effective changes are changes you made to your gradle.properties file (in the TL;DR section of the articla above, at its bottom):
#Enable daemon
org.gradle.daemon=true
# Find out the best heap size (Xmx2048m) for your project build. Just trial and error...
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# Modularise your project and enable parallel build
org.gradle.parallel=true
# Enable configure on demand.
org.gradle.configureondemand=trueFor machines with 8GB of RAM I would recommend to have 2048m or 3072m for the -Xmx argument. 4096 might choke your machine.





