Could not add entry '0' to cache localClassSetAnalysis.bin

This project was running but today when i run it it gives this error

Error:Execution failed for task ':app:compileDebugJavaWithJavac'. Could not add entry '0' to cache localClassSetAnalysis.bin (/home/blackgoogle/Desktop/SpeechToText/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis/localClassSetAnalysis.bin).

this is my app gradle file

apply plugin: 'com.android.application'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "timepass.vectorx.com.speechtotext"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.nuance:speechkit:2.1+@aar'
    compile 'com.android.support:appcompat-v7:23.4.0'
}

and this one is project 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:2.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

please guys help....

Answers


In your Project SpeechToText .gradle is hidden folder,that's it is not visible

Run this command in Ubuntu....

rm -f -r home/blackgoogle/Desktop/SpeechToText/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis

rm -f -r home/blackgoogle/Desktop/SpeechToText/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localJarClasspathSnapshot

It may be work.......


For Mac users run below command:

rm -rf /path/to/your/android/project/.gradle

I had the same problem today, goto

home/blackgoogle/Desktop/SpeechToText/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/

as shown in your stack trace . You will have a few folders there(localClassSetAnalysis & localJarClasspathSnapshot). Delete all of them and try again .Basically they add .lock because of which gradle is not able to act on those dirs.

This worked for me


If you using android studio,

1.) Open your project.

2.) Go to your project structure, and remove .gradle directory and sync project.

3.) Run application.


Go to this folder:-

/home/blackgoogle/Desktop/SpeechToText/.gradle/2.10/tasks/_app_compileDebugJavaWithJavac/localClassSetAnalysis delete all the contents of this folder. This folder might be hidden so view hidden files.

Now, rebuild the project. This is because they add .lock files in the folder automatically because of which gradle is not able to act on those dirs. Once you remove them it will work normally.


Need Your Help