Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory windows windows

Failed to delete some children. This might happen because a process has files open or has its working directory set in the target directory


The problem is that you have multiple Gradle processes that are still holding locks to your files.

You can try running gradle --stop when this happens to stop any daemons that are running in the backgorund (this usually helps).

You can also check the state of your daemons by running gradle --status. For me this outputs:

No Gradle daemons are running.Only Daemons for the current Gradle version are displayed.See https://docs.gradle.org/6.5/userguide/gradle_daemon.html#sec:status

If you see something there it might be a problem.

Using --no-daemon and --no-parallel might help, but they would just hide the underlying problem.

In my case when this happened I realized that I had processes running in the background because of tests never finishing. Check all your threading and/or coroutine usage for unclosed / unfinished processes.

One other case when this happened to me is when I was using ProcessBuilder to start another Java process and it didn't exit.


Try to restart your system. Some time no other issues, but will get above error


I went to my file system and deleted the file manually. Restarted my android