Gradle daemon locks lib folders

(sergey.morenets) #1


I have a Gradle project (Windows 10, Gradle 4.4).
Since 4.4 or 4.3 I noticed strange behavior. After my build fails (or succeeds) I can’t execute “gradle clean” command. I always get build error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':proj1:clean'.
> Unable to delete directory: C:\proj1\build\libs

So I have to kill Gradle daemon process to unlock the folders. But today I noticed that if I execute “gradle clean” again after build error (due to the lock) then build is run successfully.

Please advise,