Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Build Failed in Android Studio (Cannot read testArtifacts.bin from cache)

There is no error in the code. But the build fails with the following error:

Error:Could not read entry ':app:packageDebug' from cache taskArtifacts.bin (/Users/sibidharan/Developer/Android Dev/Karpagam/.gradle/2.10/taskArtifacts/taskArtifacts.bin).
> java.io.EOFException (no error message)

I am using Android Studio 2.0 Preview 9 on OS X 10.11.3

like image 575
Sibidharan Avatar asked Feb 26 '16 12:02

Sibidharan


People also ask

Can I delete .Gradle caches?

Clear your project directoryClear the cache of Android Studio using “File -> Invalidate Caches / Restart” choose “Invalidate and restart option” and close Android Studio. Remove your . gradle directory from the root of your project. It contains some Gradle cache files.

How do I disable Gradle cache?

gradle/gradle. properties : ? If we want to disable the build cache feature set via the global property we can use the command-line option --no-build-cache to disable the build cache for a particular build.

Where is the Gradle cache?

By default, it's located at ~/. gradle/caches . It's shared between any Gradle projects you work on, allowing Gradle to reuse task outputs from any earlier build of any other projects.


1 Answers

Removing the project-local .gradle folder did it for me. It was then recreated during the next build and all was fine again.

UPDATE:

This answer helps.

Gradle cache locates at

  • On Windows: %USER_HOME%.gradle/caches
  • On Mac/Unix: $HOME/.gradle/caches/

You can browse to these directory and manually delete it or run

rm -rf $HOME/.gradle/caches/

on Unix or OS X system.

like image 86
Sebastian Engel Avatar answered Sep 19 '22 00:09

Sebastian Engel