long zefang
long zefang

Reputation: 43

Unable to delete directory in Android Studio

When i run project in Android Studio 2.0 it shows the following error

Error:Execution failed for task ':app:clean'. > Unable to delete directory: XX\build\outputs\apk

Upvotes: 3

Views: 6499

Answers (2)

Siddharth
Siddharth

Reputation: 9574

On the mac / ubuntu, when you move projects, just deleting build folder does not help. Instead I checked ownership of folders and files and realised that android studio was expecting the ownership to me myusername:staff and the files were root:staff

I ran the cmd chown -R myusername:staff * and the build went thru fine.

Upvotes: 0

Anurag
Anurag

Reputation: 1170

In android studio terminal , go to your projects root directory and use command :

./gradlew clean

Hopefully this will work just in case if it won't,go manually and delete generated apks in output folder and rebuild your project.

Upvotes: 1

Related Questions