Fixing Grade Error at Compile Time
Today morning I opened up Android Studio and hit the run button and I banged into this error message:
So how did I fix this?
Let me tell you what I did. I deleted the .gradle directory in my projects root directory and then clicked this little icon shown in the following screenshot which says ' Sync Project with Gradle Files'. And viola the issue was fixed.
I tried clicking the first option, that didn't work. The second option didn't work. I even rebooted my computer and ended with no luck.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:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
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)
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
So how did I fix this?
Let me tell you what I did. I deleted the .gradle directory in my projects root directory and then clicked this little icon shown in the following screenshot which says ' Sync Project with Gradle Files'. And viola the issue was fixed.
thanks for this post. faced the same issue. resolved it for me.
ReplyDeleteThis post is an ass-saver. Thanks!
ReplyDelete