0

I developed few months ago an android application that is working well. I wanted then to add some updates on the code. I updated android studio and now that I want to run my code with the new Android studio i have this error :

   Error:Could not read entry ':app:packageDebug' from cache taskArtifacts.bin (/Users/sofiane/Desktop/AndroidStudioProjects/Changes/.gradle/2.10/taskArtifacts/taskArtifacts.bin).
   >com.android.build.gradle.tasks.PackageApplication$DexPackagingPolicy

Can any one help me to fix this, i can't even understand why ??

Thanx in advance.

Castiell
  • 167
  • 13

2 Answers2

2

1st Solution of this problem is

clean out the gradle system caches, Gradle cache locates at

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

Or 2nd solution for this problem is

Just delete ProjectDirectory/.gradle/taskArtifacts.bin file and restart your Android Studio.

enter image description here

Abhishek Patel
  • 4,280
  • 1
  • 24
  • 38
0

As @Sebastian Engel told, Removing the project-local .gradle folder will do it. It will be recreated during the next build and all will be fine again.

Gradle cache located 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. Refer: Gradle Build Failed in Android Studio (Cannot read testArtifacts.bin from cache)

Community
  • 1
  • 1
Tilak Madichetti
  • 4,110
  • 5
  • 34
  • 52