In the official post detailing the features of the stable release of Android Studio 2.1, I came across this:
We are also speeding up build times by using in-process dex, which converts class files to dex files within the Gradle daemon process. This avoids the costly processing operation of creating separate dex processes. To use this feature, you will need to increase the amount of memory available to the Gradle daemon to at least 2GB (1 GB is the default).
Please, how can I increase the memory that's available to Gradle?
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB. To do this set org. gradle. jvmargs=-Xmx2048M in the project gradle.
To use this feature, you will need to increase the amount of memory available to the Gradle daemon to at least 2GB (1 GB is the default).
In Android Studio 2.1 open your gradle.properties file. Find the line
\# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Uncomment the line. Gradle was faster after I did this.
In your app's build.gradle
file, add the following:
android{
//....
dexOptions {
javaMaxHeapSize "2g"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With