title: Can't sync Gradle after upgrading to Android Studio 2.3
body: <p>This happens every so often, but I can't seem to resolve it this time. Project builds fine from the command line. This is the error:</p>
  
  <pre><code>Error:org.gradle.api.internal.tasks.DefaultTaskInputs$TaskInputUnionFileCollection cannot be cast to org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
  </code></pre>
  
  <p>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>
  
  <hr>
  
  <p>None of the proposed solutions worked. I also tried invalidating caches and manually deleting Gradle caches to force redownload of dependencies and wrapper.</p>
  
  <p><strong>EDIT:</strong> "Upgrading to the latest build tools and Gradle version" is <em>not</em> a solution because <a href="https://code.google.com/p/android/issues/detail?id=220611" rel="nofollow noreferrer">this</a> issue still exists. And the current workaround to <em>that</em> issue is to disable test coverage "temporarily." As that issue was originally reported 6 months ago (and despite it's being triaged as "critical"), the workaround is not only bad, but not temporary.</p>