title: Android Studio Gradle fails to build
body: <p>I am facing this problem from some few days. 
  When I try to build the project gradle thorws this message.
  I cleaned the project re downloaded the dependencies but still problem has not be solved.</p>
  
  <p>Help me to find out the fix.</p>
  
  <p>Error message</p>
  
  <pre><code>:app:dexDebug
  Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot
  Possible causes for this unexpected error include:&lt;ul&gt;&lt;li&gt;Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
  &lt;a href="syncProject"&gt;Re-download dependencies and sync project (requires network)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
  &lt;a href="stopGradleDaemons"&gt;Stop Gradle build processes (requires restart)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
  </code></pre>