3

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

Biswajit Karmakar
  • 9,799
  • 4
  • 39
  • 41
long zefang
  • 43
  • 1
  • 4

2 Answers2

1

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.

Anurag
  • 1,162
  • 6
  • 20
0

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.

Siddharth
  • 9,349
  • 16
  • 86
  • 148