title: Access to the dex task is now impossible, starting with 1.4.0
body: <p>I cant upgrade my project to gradle 1.5: </p>
  
  <p>build.gradle(root) project refresh failed: Access to the dex task is now impossible, starting with 1.4.0.
  Error: 1.4.0 introduces a new Transform API allowing manipulating of the .class files.</p>
  
  <p>Any suggestion?</p>
  
  <p>root build.gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
  dependencies {
      classpath 'com.android.tools.build:gradle:1.5.0'
      }
  }
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  
  subprojects {
      task allDependencies(type: DependencyReportTask) {}
  }
  </code></pre>
  
  <p>app build.gradle:</p>
  
  <pre><code>buildscript {
  repositories {
      mavenCentral()
      maven { url 'http://download.crashlytics.com/maven' }
  }
  
  dependencies {
      classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.14.7'
      classpath "com.newrelic.agent.android:agent-gradle-plugin:4.244.0"
  }
  }
  
  repositories {
  mavenCentral()
  maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  maven { url 'http://download.crashlytics.com/maven' }
  }
  
  task wrapper(type: Wrapper) {
  gradleVersion = '2.7'
  }
  
  apply plugin: 'com.android.application'
  
   android {
  compileSdkVersion rootProject.ext.compileSdkVersion
  buildToolsVersion rootProject.ext.buildToolsVersion
  
  compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
  }
  
  signingConfigs {
      release
  }
  
  testBuildType "debug"
  
  defaultConfig {
      targetSdkVersion 23
      minSdkVersion 14
  
      multiDexEnabled true
  
      applicationId "com.freelancer.android.messenger"
      versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
      versionName "${versionMajor}.${versionMinor}.${versionPatch}"
      testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
  
      renderscriptTargetApi 21
      renderscriptSupportModeEnabled true
  
  }
  
  sourceSets {
      production {
          java.srcDir 'src/common/java'
      }
  
      develop {
          java.srcDir 'src/common/java'
      }
  
      staging {
          java.srcDir 'src/common/java'
      }
  }
  
  buildTypes {
      release {
          signingConfig signingConfigs.release
          minifyEnabled true
          proguardFile 'proguard.cfg'
          buildConfigField "String", "CONTENT_PROVIDER_AUTHORITY",
                  "\"com.freelancer.android.messenger.content_provider\""
      }
      debug {
          applicationIdSuffix '.debug'
          versionNameSuffix '.' + versionBuild + '-debug' + gitSha
          buildConfigField "String", "CONTENT_PROVIDER_AUTHORITY",
                  "\"com.freelancer.android.messenger.content_provider.\" + BUILD_TYPE.toLowerCase()"
          debuggable true
          testCoverageEnabled = true
      }
  
      staging {
          applicationIdSuffix '.staging'
          versionNameSuffix '-staging-' + gitSha
  
          buildConfigField "String", "BASE_URL_API", "\"${rootProject.ext.stagingApiServer}\""
          buildConfigField "String", "BASE_URL_AUTH", "\"${rootProject.ext.stagingAuthServer}\""
          buildConfigField "String", "BASE_URL_WSS", "\"${rootProject.ext.stagingWsServer}\""
          buildConfigField "String", "BASE_URL_GAF", "\"${rootProject.ext.stagingGafUrl}\""
      }
  }
  
  
  productFlavors {
      // Define separate dev and prod product flavors.
      develop {
          // dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
          // to pre-dex each module and produce an APK that can be tested on
          // Android Lollipop without time consuming dex merging processes.
          minSdkVersion 21
      }
      production {
          // The actual minSdkVersion for the application.
      }
      mock {
  
      }
  
  }
  
  // from android 6 apache its been deprecated: refer to -&gt;
  // http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html
   //    useLibrary 'org.apache.http.legacy'
  
  }
  
  
  dependencies {
  
  compile 'com.android.support:appcompat-v7:22.2.0'
  compile 'com.android.support:support-v4:22.2.0'
  compile 'com.android.support:cardview-v7:22.2.0'
  compile 'com.android.support:palette-v7:22.2.0'
  compile 'com.android.support:multidex:1.0.1'
  compile 'com.android.support:recyclerview-v7:22.2.0'
  compile 'com.android.support:design:22.2.0'
  
  compile 'com.google.android.gms:play-services-gcm:7.5.0'
  compile 'com.google.android.gms:play-services-maps:7.5.0'
  compile 'com.google.android.gms:play-services-location:7.5.0'
  compile 'com.google.android.gms:play-services-analytics:7.5.0'
  
  compile 'com.google.maps.android:android-maps-utils:0.3.4'
  compile 'com.google.code.gson:gson:2.3'
  
  // extension for popular dashclock app
  compile 'com.google.android.apps.dashclock:dashclock-api:2.0.0'
  
  compile 'com.jakewharton:butterknife:4.0.1'
  compile 'com.squareup:otto:1.3.5'
  compile 'com.squareup.dagger:dagger:1.2.2'
  compile 'com.squareup.dagger:dagger-compiler:1.2.2'
  compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
  compile 'com.squareup.okhttp:okhttp:2.5.0'
  
  compile ('com.facebook.android:facebook-android-sdk:3.23.0') {
      exclude group: 'com.google.android'
  }
  
  compile 'com.newrelic.agent.android:android-agent:4.244.0'
  compile "com.mixpanel.android:mixpanel-android:4.5.3"
  compile 'com.crashlytics.android:crashlytics:1.1.13'
  
  compile 'com.github.kevinsawicki:http-request:6.0' // TODO deprecate and replace methods with okhttp
  
  compile 'com.koushikdutta.async:androidasync:1.2.9@jar'
  compile 'com.koushikdutta.ion:ion:1.2.9@jar'
  compile 'com.path:android-priority-jobqueue:1.1.2'
  compile 'com.readystatesoftware.systembartint:systembartint:1.0.3'
  compile 'com.soundcloud.android:android-crop:0.9.10@aar'
  
  compile project(':libs:stickylistheaders:library')
  compile project(':libs:android-core:android-core-library')
  compile project(':libs:viewpagerindicator:library')
  compile project(':libs:PagerSlidingTabStrip')
  
  compile "org.mockito:mockito-core:1.10.19"
  compile 'com.google.dexmaker:dexmaker:1.2'
  compile 'com.google.dexmaker:dexmaker-mockito:1.2'
  
  compile 'com.bartoszlipinski.flippablestackview:library:1.2.1'
  compile 'com.edmodo:rangebar:1.0.0'
  compile 'com.github.clans:fab:1.6.1'
  
  compile fileTree(dir: '../libs', include: '*.jar')
  
  testCompile('org.robolectric:robolectric:3.0') {
      exclude group: 'commons-logging', module: 'commons-logging'
      exclude group: 'org.apache.httpcomponents', module: 'httpclient'
      exclude group: 'com.android.support', module: 'appcompat'
      exclude group: 'com.android.support', module: 'support-v4'
      exclude group: 'com.android.support', module: 'recyclerview-v7'
  }
  testCompile "org.robolectric:shadows-multidex:3.0" // this is needed to avoid multidex
  
  // Dependencies for local unit tests
  //    testCompile "org.assertj:assertj-core:$rootProject.ext.assertjCore"
  testCompile "org.hamcrest:hamcrest-all:$rootProject.ext.hamcrestVersion"
  testCompile "junit:junit:$rootProject.ext.junitVersion"
  testCompile "org.mockito:mockito-all:$rootProject.ext.mockitoVersion"
  testCompile "org.powermock:powermock-module-junit4:$rootProject.ext.powerMockito"
  testCompile "org.powermock:powermock-api-mockito:$rootProject.ext.powerMockito"
  
  // Android Testing Support Library's runner and rules
  androidTestCompile "com.android.support.test:runner:$rootProject.ext.runnerVersion"
  androidTestCompile "com.android.support.test:rules:$rootProject.ext.runnerVersion"
  
  // Espresso UI Testing dependencies.
  androidTestCompile "com.android.support.test.espresso:espresso-core:$rootProject.ext.espressoVersion"
  androidTestCompile "com.android.support.test.espresso:espresso-contrib:$rootProject.ext.espressoVersion"
  androidTestCompile "com.android.support.test.espresso:espresso-intents:$rootProject.ext.espressoVersion"
  
  // dependencies added after dex split
  //    compile 'com.jakewharton.timber:timber:3.1.0'
   }
  
  
   configurations.all {
       resolutionStrategy.force "com.android.support:support-   annotations:$rootProject.supportLibraryVersion"
       resolutionStrategy.force "org.hamcrest:hamcrest-core:$rootProject.hamcrestVersion"
       resolutionStrategy.force "com.squareup:javawriter:2.5.0"
  }
  
   configurations.compile.dependencies.each { compileDependency -&gt;
       println "Excluding compile dependency: ${compileDependency.getName()}"
       configurations.androidTestCompile.dependencies.each { androidTestCompileDependency -&gt;
           configurations.androidTestCompile.exclude module:    "${compileDependency.getName()}"
      }
   }
  </code></pre>
  
  <p>Im following the <a href="https://codelabs.developers.google.com/codelabs/android-testing/">https://codelabs.developers.google.com/codelabs/android-testing/</a> to get the test working on my project (mokito for instance) but it doesnt work. </p>