title: Android Gradle Build Slow
body: <p>I am trying to figure out why our Gradle build is so slow. Currently each time you hit build with no changes the build time is around 45 seconds. This is a single module project. I have turned on profiling and most of the time is spent on <code>:app:dexDebug</code>. We are build using Gradle 2.8 and my dex options are as follows:</p>
  <pre><code>dexOptions {
          preDexLibraries = false
          incremental true
          javaMaxHeapSize &quot;4g&quot;
      }
  </code></pre>
  <p>From the profile report:</p>
  <pre><code>:app 43.957s (total) 
  :app:dexDebug 28.727s 
  </code></pre>
  <p>Is there a way to speed this up? Why does dex have to be rebuilt each time?</p>