18

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

ThomasW
  • 16,981
  • 4
  • 79
  • 106
Sibidharan
  • 2,717
  • 2
  • 26
  • 54

2 Answers2

36

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.

Community
  • 1
  • 1
Sebastian Engel
  • 3,500
  • 32
  • 30
0

Step-1: clean project

Step-2: Invalidate cashes

Step-3: Go to project structure and check problems then fix the suggested issues like broken class paths.

Step-4: Go to home directory of your PC or laptop and show hidden files, here you will get .gradle file delete it permanently and then restart android studio and build the project with file downloads.

Gradle caches 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.

Note: .gradle should be deleted permanently from trash too.

Shiva Yadav
  • 72
  • 1
  • 9