The following file documents possible modifications for building Android projects.
Keeps Gradle running in the background as a daemon. This may speed up compilation times.
- Go to the project's Gradle properties file (NOT the module's Gradle file)
- Place the following code:
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Note: The second line specifies how much memory will be allocated for the daemon process. Use a suitable value according to your computer's RAM memory size. Don't use too much, remember that you will need memory for Android Studio as well.
Enables incremental building of Android's DEX files. This may speed up compilation times.
- Go to the app's module Gradle file (the same file used for dependencies)
- Place the following code:
dexOptions {
incremental true
}