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:
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:
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

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.

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.

Comments

  1. thanks for this post. faced the same issue. resolved it for me.

    ReplyDelete
  2. This post is an ass-saver. Thanks!

    ReplyDelete

Post a Comment

Popular posts from this blog

Automate file upload in Selenium IDE

How To Install and Configure Nextcloud