Blog

Speed Up Gradle in Android Studio

Craig Isakson  |  June 12, 2014

It was about a year ago when Google announced that they were working on Android Studio as the IDE to replace ADT. Android Studio uses IntelliJ at its core and replaces the use of ANT for building projects to using Gradle.

If you have just started using Android Studio or are new to Gradle, you may have noticed that any of the calls to Gradle perform very slow. This is very noticeable while trying to build the project. This is very discouraging. Thankfully a helpful tip from a colleague pointed me to this blog post by Tim Roes who has a very helpful tip on telling Gradle to use a daemon to build the projects. This can be completed by creating a gradle.properties file in the following directory:

  • home//.gradle/ (Linux)
  • /Users//.gradle/ (Mac)
  • C:\Users\\.gradle (Windows)

And adding this line to the file:

org.gradle.daemon=true

Just save and restart and you should be good to go. Another helpful tip is to open preferences in Android Studio, click on Compiler and check the “Compile independent modules in parallel” checkbox while also adding VM Options. I have had confirmation from a fellow Android developer of a very large Android app that took his compile time from 90 seconds down to 23 seconds.

These are great results and really helps speed up the development process. If you have any questions or comments, feel free to send them my way!

Posted in: Google, Mobile, Software Development, Technology, Technical Strategy

Share