Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facing an error while building. Gradle may be corrupt

Tags:

android

gradle

I'm getting the following error:

    Error:org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot cannot be cast to org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl
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><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.

Can anyone tell me how to solve it?

like image 430
Sourabh Avatar asked May 27 '16 09:05

Sourabh


People also ask

What does gradle build do?

Gradle builds are used to define a project and its tasks. At least one Gradle build file is located in the root folder of the project. A task represents the work that a Gradle build has to perform, e.g., compiling the source code of the program. You can execute multiple tasks at a time under one build file.


1 Answers

Try this solution

1.delete {project dir}/.gradle/1.9

2.Sync Project with Gradle File

**

OR

**

If it doesn't work then try for this solution:

  • Clone project to a new folder

  • Remove .gradle, .idea folders

  • Add as a new project (File > Open > [new folder])

like image 69
U.Swap Avatar answered Oct 31 '22 01:10

U.Swap