title: Android gradle project builds very slowly
body: <p>We have changed our Android app project to use gradle, but have noticed it is building significantly slower.</p>
  
  <p>Before with ANT:<br/>
  6 sek / 50 sec (with clean)</p>
  
  <p>After with gradle:<br/>
  30 sek / 80 sec (with clean)</p>
  
  <p>I have profiled the solution with:</p>
  
  <pre><code>gradle assembleDebug --profile
  </code></pre>
  
  <p>The main tasks in the resulting report was thies tasks: (in the build without clean)</p>
  
  <pre><code>:packageDebug   10.690s     
  :processDebugResources  8.795s  
  :compileDebugJava   7.644s  
  </code></pre>
  
  <p>I don't have any ideas about getting more details information about thies tasks.</p>
  
  <p><strong>Is this normal? How could this be improved?</strong><br/>
  I know the new build system is still in betas, but it seems like others are building much faster.</p>
  
  <p><br/>
  I have looked around without finding a solution I have tried several things including making sure gradle deamon is enabled with a gradle.properties file containing this:</p>
  
  <pre><code>org.gradle.daemon=true
  org.gradle.jvmargs=-Xms128m -Xmx256m
  org.gradle.parallel=true
  </code></pre>
  
  <p>build.gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
          maven { url 'http://download.crashlytics.com/maven' }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.7.+'
          classpath 'com.google.guava:guava:14.0.1'
          classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
          classpath 'me.tatarka:gradle-retrolambda:1.1.1'
          classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
      }
  }
  
  repositories {
      mavenCentral()
      maven { url 'http://download.crashlytics.com/maven' }
  }
  
  apply plugin: 'android'
  apply plugin: 'crashlytics'
  apply plugin: 'retrolambda'
  apply plugin: 'android-apt'
  
  dependencies {
      compile fileTree(dir: 'libs', include: '*.jar')
      compile 'com.google.guava:guava:14.0.1'
      compile 'com.crashlytics.android:crashlytics:1.+'
      apt "org.androidannotations:androidannotations:3.0.1"
      compile "org.androidannotations:androidannotations-api:3.0.1"
  }
  
  apt {
      arguments {
          resourcePackageName "com.example"
          androidManifestFile variant.processResources.manifestFile
      }
  }
  
  android {
      packagingOptions { //Fix: http://stackoverflow.com/a/20675331/860488
          exclude 'META-INF/DEPENDENCIES'
          exclude 'META-INF/LICENSE'
          exclude 'META-INF/NOTICE'
      }
  
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  
      compileSdkVersion 10
      buildToolsVersion "18.0.1"
  
      defaultConfig {
          minSdkVersion 7
          targetSdkVersion 10
          buildConfigField "boolean", "useProductionServices", "true"
      }
  
      buildTypes {
          testflight.initWith(buildTypes.debug)
          debug {
              packageNameSuffix ".debug"
              buildConfigField "boolean", "useProductionServices", "false"
          }
  
          testflight {
              packageNameSuffix ".testflight"
              buildConfigField "boolean", "useProductionServices", "true"
          }
  
          release {
              buildConfigField "boolean", "useProductionServices", "true"
          }
      }
  }
  
  retrolambda {
      compile "net.orfjackal.retrolambda:retrolambda:1.1.2"
      jdk System.getenv("JAVA8_HOME")
  }
  </code></pre>