[ACCEPTED]-Could not add entry to cache fileSnapshots.bin-android-studio

Accepted answer
Score: 30

I just had this happen to me. Deleted the 4 ".gradle" directory and then did a "Sync 3 Project with Gradle Files". Once I did 2 that, I was able to successfully build the 1 project again.

Score: 15

open terminal in android studio and type 4 this command and rebuild your project it 3 will 100% work

Note: -this command will only work with mac or linux machines

rm -R .gradle

In case of windows you can 2 find similar command to delete the directory forcefully 1 and it works

Score: 14

Same issue here for build of Android apk 2 using Android Studio 1.0.2.

I have removed the file fileSnapshots.bin

Afterwards I 1 did clean + rebuild from the menu.

Score: 3

Just go and delete the fileSnapshots.bin file located under:

/{YourProjectLocation}/.gradle/{YourGradleVersion}/taskArtifacts/fileSnapshots.bin

E.g. for me it was here:

~/Projects/MyProjectName/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin

0

Score: 2

This happened to me too, the following command 1 fixed it:

gradlew -C rebuild
Score: 0

change in your Project build.gradle version 2 on 1.5 Here build.gradle file:

// Top-level build file where you can add configuration options 
common to all sub-projects/modules.
buildscript {
 repositories {
    jcenter()
 }
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
  }
}
allprojects {
  repositories {
    jcenter()
  }
}

and in gradle-wrapper.properties be sure, that 1 you use gradle of version 2.8

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

More Related questions