title: Extremely slow gradle build
body: <p>The following measures were taken to speed up gradle build from this (<a href="https://stackoverflow.com/questions/17324849/android-studio-gradle-build-speed-up">SO post</a>)</p>
  
  <ol>
  <li>org.gradle.parallel=true, org.gradle.daemon=true</li>
  <li>build from terminal and not from android Studio</li>
  <li>building with ./gradlew assembleDebug --offline</li>
  </ol>
  
  <p>Problem:</p>
  
  <ol>
  <li>Even after these measures build times can take upto 6-8 minutes for a single line of code change! and during this time computer mostly freezes and nothing else can be done except to stare at the terminal. I've noticed that "app:dexDebug" takes a lot of time in this. What are the possible causes?</li>
  </ol>
  
  <p>Relevant files:</p>
  
  <ol>
  <li><a href="https://gist.github.com/firehawk895/9abf602936f1421c7399" rel="nofollow noreferrer">Terminal build dump</a></li>
  <li><a href="https://gist.github.com/firehawk895/17706730452d85bb6ae0" rel="nofollow noreferrer">build.gradle(app)</a></li>
  <li><a href="https://gist.github.com/firehawk895/b1c9ed3a292dfff301a1" rel="nofollow noreferrer">build.gradle(project)</a></li>
  </ol>
  
  <p>System details:</p>
  
  <ol>
  <li>Android Studio 1.2.2</li>
  <li>Description: Ubuntu 14.04.2 LTS</li>
  </ol>