Unable to delete directory in Android Studio

若如初见. 提交于 2019-12-02 23:13:46

I have exactly the same problem. The only temporary solution I've found is to exit Android Studio, delete the entire "build" folder (not only the jars), and then getting back to Android Studio to Build it.

The first build goes without errors or any warnings, but to rebuild again you need to follow the same steps as before :(

This is not a solution, obviously, but seems like the problem comes out from any service keeping occupied the files to be deleted in the "Clean" part of the rebuilding process.

EDIT:

It seems there is a problem with NTFS file system in android 2.0 Check out in https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=206219

i'm using android studio 2.0 and ubuntu 14.04 64bit.

i have the same problem, i just delete directory under ../app/build/intermediates/exploded-aar/com.android.support/

i delete all of this

it works, i can run my project, but it will be showed again in the next running.

I'm using Android Studio 2.3.3 on windows, had the same problem, tried deleting the folder and got Access denied, rebooting my computer did not help either, for me the solution was : In Android Studio > File > Invalidate Caches / Restart...

Dilleyboy

I noticed this started happening after I installed Tortoise SVN. I think installing it using a non-admin Windows account, might be the root of the issue.

For me, rebooting my computer unlocked the locked file and solved the problem.

After weeks of searching, I've found out that my Cloud-Sync-programs (I am using Tresorit, but same would apply to Dropbox or Google Drive aso) locked the files that AndroidStudio was trying to delete while uploading them to the cloud storage - and therefore making it impossible for AndroidStudio to delete the files.

On some cloud storage programs, you may use path filters - simply exclude the "build"-directories from your cloud storage (you usually dont need them backupped either way), or pause your cloud sync while working on the project.

Try to make the usage of the “file smash” function from tencent qq pc manager. The manager can unlock the file and then delete it.

Where to use it? After you install QQ pc manager, choose tool kits and install "file smash" tool. And then choose the file to delete, press right key of mouse and you find the function to unlock file and delete it.

That works for me. I guess other pc manager like qq manager may have this function too. That's all.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!