无法使用 GradleUserHomeServices.createCachingFileHasher() 创建 FileHasher 类型的服务
当我尝试同时运行 2 个 gradle 项目时,它会抛出以下错误:
无法使用 GradleUserHomeServices.createCachingFileHasher() 创建 FileHasher 类型的服务。
等待锁定文件哈希缓存超时(/Users/username/.gradle/caches/6.4/fileHashes)。它当前正被另一个 Gradle 实例使用。
所有者 PID:40300
我们的PID:44136
业主操作:
我们的运作:
锁定文件:/Users/epereda/.gradle/caches/6.4/fileHashes/fileHashes.lock
我读过最好的解决方案是使用命令“killall -9 java”或某些衍生命令杀死几乎所有的java进程这会杀死阻止新应用程序启动的进程,是的,当我完成一个应用程序时,我可以启动任何其他应用程序,但问题是我实际上需要运行 3 个在本地相互通信的应用程序机器,但是当我运行第一个机器时,其他两个机器给我这个错误。
When I try to run 2 gradle projects simultaneously, it throws me the following error:
Could not create service of type FileHasher using GradleUserHomeServices.createCachingFileHasher().
Timeout waiting to lock file hash cache(/Users/username/.gradle/caches/6.4/fileHashes). It is currently in use by another Gradle instance.
Owner PID: 40300
Our PID: 44136
Owner Operation:
Our operation:
Lock file: /Users/epereda/.gradle/caches/6.4/fileHashes/fileHashes.lock
I have read that the best solution is to kill practically all the java processes with the command "killall -9 java" or some derivative that kills the process that prevents the new application from starting, and yes, when I finish an application I can start any of the others , but the thing is that I actually need to run 3 applications that communicate with each other on my local machine, but when I run the first one, the other 2 give me that error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
例外:
删除锁定文件对我有用
Exception:
Removing lock file worked for me
如果有人发现它有用,我会回答我自己的问题:
解决方案是为每个作业指定不同的 gradle-user-home。具体来说,将其设置为当前工作目录。 (即项目目录),您可以使用以下命令来完成此操作:
I'll answer my own question in case someone finds it useful:
The solution is to specify a different gradle-user-home for each job. Specifically, setting it to the current working directory. (i.e. project directory) and you can do it whit the following command: