它当前正被另一个 Gradle 实例使用 [英] It is currently in use by another Gradle instance
问题描述
我是 Gradle 构建系统的新手.我想在上面做一些基本的功能.我正在命令行中运行/构建它.我指的是用户指南.并且,做一些简单的任务.
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.
当我开始运行简单的任务时,它构建成功.但是,一段时间后,它显示它当前正在被另一个 Gradle 实例使用"
并变为 BUILD FAILED
.我正在使用终端来运行任务.那个时候我什么都没跑.
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?
如何解决?
并且,请参考任何链接以提高我对 Android 中 Gradle Build 系统的了解.
And, Please refer any link to improve my knowledge on Gradle Build system in Android.
推荐答案
通过执行以下操作来移除 gradle 缓存中的锁定文件:
Remove the lock files in the gradle cache by executing something like this:
find ~/.gradle -type f -name "*.lock" -delete
这篇关于它当前正被另一个 Gradle 实例使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!