Android Studio Gradle无法构建

Aaw*_*ali 5 android android-studio

几天后我才面临这个问题.当我尝试构建项目gradle thorws这条消息时.我清理了项目重新下载的依赖项,但仍然没有解决问题.

帮我找出修复方法.

错误信息

: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:<ul><li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a></li><li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
<a href="stopGradleDaemons">Stop Gradle build processes (requires restart)</a></li></ul>In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Run Code Online (Sandbox Code Playgroud)

Sha*_*law 9

像这样的类似问题:stackoverflow上的类似问题

我按照那个答案解决了我的问题.希望它也会对你有所帮助.