It is currently in use by another Gradle instance

Dhasneem picture Dhasneem · Feb 3, 2014 · Viewed 86.1k times · Source

I'm new to Gradle build system. I want to do some basic functions on it. I'm running/building it in command line. I am referring User guide. And, doing some simple tasks.

When I start to run simple tasks, it was build successfully. But, After some times, it is showing "It is currently in use by another Gradle instance" and becomes BUILD FAILED. I'm using a terminal for run the task. I didn't run anything at that time.

If I closed the terminal which generate the error, this problem would be solved. But, I know that it is not the solution for that.

Why is this error coming frequently?

How to solve it?

And, Please refer any link to improve my knowledge on Gradle Build system in Android.

Answer

The night manager picture The night manager · Sep 25, 2015

Remove the lock files in the gradle cache by executing something like this:

find ~/.gradle -type f -name "*.lock" -delete