title: Android Studio - Gradle incremental build
body: <p>In the last few days I have been trying to improve the build time for our project with no luck. I don't mind having to wait 1m40s for a clean build, but if I insert one line in a single java file, I get the same build time as in a clean build. I must be doing something wrong but I simply can't find any documentation or stack overflow question that points me in the right direction. I managed to gather a bunch of information that I will centralize here in the hope that someone with a better understanding of the topic explain me why I get these abysmal build times.</p>
  
  <p>Here it goes:</p>
  
  <ul>
  <li><p>I understand that this option in my build.gradle file is what I seek.</p>
  
  <pre><code>android {
      dexOptions {
          incremental true
      }
  ...
  </code></pre>
  
  <p>Glorious incremental build. However, this doesn't work for me apparently because my project uses the multidex feature for retrocompatibility with android versions before Lollipop.</p></li>
  <li><p>Proguard to the rescue! With Proguard I am able to minify my executable and remove all the unused methods. I got a couple of errors with proguard minify but was able to set it properly and get it working. Great! Dex generation takes about 20s for every build. Unfortunately, nothing is for free, and the proguard gradle task takes about 2m50s to run. Even worse than my initial case.</p></li>
  </ul>
  
  <p>Is there a solution to this problem?</p>