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.
This may be happening because there is more than just once instance of Android Studio.
Have tried all this answers, including kill java process, delete .gradle in HOME_DIR and in project dir, restarted Android Studio, and even restarted OS.
It started to work normally only after I launched gradle sync.
While killing the process and/or removing the lock file works, Gradle should be able to handle this on its own, solving the problem permanently. This problem report hints at the solution: Gradle cannot communicate with the gradle service.
Have a look at your local network firewall. In my case,
allowing outbound traffic from 127.0.0.1 to 127.0.0.1,
allowing incoming traffic from 127.0.0.1
solved the issue. A discussion of a similar problem at github.
The udacity gradle course, if you have some time.
I was facing the same problem. But I solved it by just restarting my android studio. I am using OneDrive to save my project.