Reputation: 43
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
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
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