Castiell
Castiell

Reputation: 167

Error when running in the new Android studio

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.

Upvotes: 0

Views: 458

Answers (2)

Abhishek Patel
Abhishek Patel

Reputation: 4328

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

Upvotes: 2

Tilak Madichetti
Tilak Madichetti

Reputation: 4346

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)

Upvotes: 0

Related Questions