title: Error:org.gradle.api.internal.changedetection.state
body: <p>I am trying to test an app on my phone. Whenever I build the project I get the following error in Android Studio  2.2.</p>
  
  <p>Error:org.gradle.api.internal.changedetection.state.FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot
  Possible causes for this unexpected error include:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
  Re-download dependencies and sync project (requires network)</li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
  Stop Gradle build processes (requires restart)</li><li>Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.</li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.</p>
  
  <p>build.gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 24
      buildToolsVersion "24.0.3"
      defaultConfig {
          applicationId "com.example.harshohri.myapplication"
          minSdkVersion 15
          targetSdkVersion 24
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })
      compile 'com.android.support:appcompat-v7:24.2.1'
      compile 'com.google.android.gms:play-services:9.6.1'
      compile 'com.android.support:support-v4:24.2.1'
      testCompile 'junit:junit:4.12'
  }
  </code></pre>
  
  <p>I killed java processes by restarting the computer. I deleted the gradle and reinstalled it but still facing the error</p>