title: Gradle project refresh failed: No signature of method PreDexCache.clear() applicable
body: <p>I am getting a strange error during gradle sync of imported project. I do not understand how to solve.</p>
  
  <pre><code>Gradle project refresh failed
  Error:No signature of method: com.android.builder.internal.compiler.PreDexCache.clear() is applicable for argument types: (java.io.File, com.android.build.gradle.internal.LoggerWrapper) values: [E:\GardleWorkSpace\MAIN_APP\build\intermediates\dex-cache\cache.xml, ...]
  Possible solutions: clear(java.io.File, com.android.utils.ILogger), load(java.io.File), grep(), collect(), every(), sleep(long, groovy.lang.Closure)
  </code></pre>
  
  <p>I have tried deleting and importing multiple times.
  Also **E:\GardleWorkSpace\MAIN_APP\build** this folder does not exists in my machine.</p>
  
  <p>Please help. I have tried searching a lot but no one with the same problem found. Error is suggesting some solution I do not understand how and where to apply.</p>
  
  <p>build.gradle</p>
  
  <pre><code>import org.apache.tools.ant.taskdefs.condition.Os
  
  project.ext.set("archivesBaseName", "Project");
  
  android {
  
      dependencies {
          // Support Library Features (https://developer.android.com/tools/support-library/features.html)
          compile group:'com.android.support', name:'support-v4', version: '22.0.0'
          compile group:'com.android.support', name:'palette-v7', version: '21.0.0'
      }
  
      defaultConfig {
          versionCode 221505001
          versionName "1.0"
          minSdkVersion 22
          targetSdkVersion 22
          multiDexEnabled true
  
      }
  
      dexOptions {
          jumboMode = true
          if (Os.isFamily(Os.FAMILY_WINDOWS) &amp;&amp; Os.isArch("x86")) {
              javaMaxHeapSize "1g"
          } else {
              javaMaxHeapSize "2g"
          }
      }
  
      lintOptions {
          quiet true  // set to true to turn off analysis progress reporting by lint
          abortOnError false  // if true, stop the gradle build if errors are found
          ignoreWarnings true  // if true, only report errors
          checkAllWarnings true  // if true, check all issues, including those that are off by default
          warningsAsErrors true  // if true, treat all warnings as errors
          disable 'TypographyFractions', 'TypographyQuotes'  // turn off checking the given issue id's
          //enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'  // turn on the given issue id's
          check 'NewApi', 'InlinedApi'  // check *only* the given issue id's
          noLines true  // if true, don't include source code lines in the error output
          showAll true  // if true, show all locations for an error, do not truncate lists, etc.
          textReport true  // if true, generate a text report of issues (false by default)
          textOutput 'stdout'  // location to write the output; can be a file or 'stdout'
      }
  }
  </code></pre>