最近在编译项目时候老是不通过:报错Error:Execution failed for task ':app:clean'. > Unable to delete directory: F:\app\build\intermediates,好郁闷。
不过在网上找到了一种方法,Window系统需要在网上下载LockHunter(http://lockhunter.com/download.htm),然后就在你项目的build.gradle里面添加task clean(type:Exec){ext.lockhunter='\"C:\\LockHunter.exe\"'defbuildDir=file(newFile("build"))commandLine'cmd',"$lockhunter",'/delete','/silent',buildDir}同步即可。