gradle clean can't delete file on Windows

Posted vevidp

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gradle clean can't delete file on Windows相关的知识,希望对你有一定的参考价值。

Every now and again I run into a problem where cleaning my android build folder just doesn‘t work.

You can use File Explorer, gradle, even WSL with a `sudo rm -rf app/build`, yet I am still unable to delete it.

It‘s usually a single file that gets stuck. A reboot will certainly fix it, but there is a much simpler way!

  • Press Win+R and type resmon then click OK
  • Click the CPU tab and open Associated Handles
  • Type the stuck file‘s name into the search box
  • Look for adb.exejava.exe, or some other Android related process
  • Right-click and select End Process

Now try deleting doing whatever Windows refused to do before. Coming from macOS and Linux I find this pretty silly.

If you operate with admin privileges you should be able to completely own the file system,

for better or worse. In this case, you are probably just trying to do your job and some tool got stuck.

 

原文地址

以上是关于gradle clean can't delete file on Windows的主要内容,如果未能解决你的问题,请参考以下文章

错误记录Android Studio 中 Gradle 配置报错 ( Can‘t determine type for tag ‘<item name=““ type=“String“>)

Execution failed for task ':app:clean'.

gradle clean 后 Gradle Build Cache

170318 11:44:26 [ERROR] Can't start server: can't create PID file: No space left on device

Can't find model 'en'

如何扩展 gradle 的 clean 任务以删除文件?