Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Gradle Error at Compile Time

Tags:

android

gradle

I have an Android App in Android Studio. When I build project with Gradle File,it gives me one error at compile time. Error Report:

Error:org.gradle.api.internal.changedetection.state.DefaultFileCollectionSnapshotter$FileCollectionSnapshotImpl cannot be cast to org.gradle.api.internal.changedetection.state.OutputFilesCollectionSnapshotter$OutputFilesSnapshot 

Please Give me solution about this error.

like image 942
Net-Android Avatar asked Oct 14 '14 06:10

Net-Android


People also ask

Why is my Gradle sync failing?

Using the Proxy Servers: There was an issue with the syncing of the Gradle when Proxy Servers were turned on. Disabling it can help. Cache Memory: Android Studio uses Cache memory for fast and smooth usage of the app. Sometimes the cache gets corrupted due to which Gradle sync fails.

Where is compiler error output Android studio?

Go to File > Settings > Build, Execution, Deployment > Compiler.


2 Answers

1.delete {project dir}/.gradle/{gradle distribution version dir}

{gradle distribution version dir} is whatever the gradle distribution version you use (ref: https://developer.android.com/studio/releases/gradle-plugin.html#revisions). For example, it can be "1.9" or "2.10" or some other version number.

2.Sync Project with Gradle File

like image 55
MAC113 Avatar answered Sep 24 '22 02:09

MAC113


This is what worked for me:

Android Studio -> File -> Invalidate Caches and Restart

like image 44
Greg Ennis Avatar answered Sep 27 '22 02:09

Greg Ennis