我是gradle新手,当我尝试简单检查gradle内置任务时,我收到了Build Failed错误。
谁能解释一下出了什么问题?
我只在cmd上运行'gradle tasks',然后得到下一个错误:
FAILURE: Build failed with an exception.
* What went wrong:
Gradle could not start your build.
> Could not create service of type ChecksumService using BuildSessionScopeServices.createChecksumService().
> Timeout waiting to lock checksums cache (M:\.gradle\checksums). It is currently in use by another Gradle instance.
Owner PID: unknown
Our PID: 14372
Owner Operation: unknown
Our operation:
Lock file: M:\.gradle\checksums\checksums.lock
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with
--scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 1s
6条答案
按热度按时间sycxhyv71#
./gradlew --stop
,因为当gradle未完全关闭时会发生错误。例如:Cannot lock checksums cache (/Users/.../StudioProjects/android/.gradle/7.4.2/checksums) as it has already been locked by this process.
x6492ojm2#
这对我来说是一个权限问题。我试图从我安装的Google云端硬盘目录在Mac上运行一个项目,但遇到了这个错误。
将项目移至文档工作。
qv7cva1a3#
我在Mac OS Monterey(M1处理器)上遇到过这个问题
1.浏览android/buil. gradle添加或更新gradle版本至7.1.2
1.将android/gradle/wrapper/www.example.com中的分发URL更新至7.4 gradle-wrapper.properties to 7.4
1.在终端中导航到android文件夹并运行
德斯皮埃斯
4.跑得干干净净,扑到酒馆里去
1.然后运行Flutter运行
kmbjn2e34#
FWIW,我忘记停止Intellij中的服务器,一旦我这样做了,问题就消失了。
sr4lhrrt5#
我的工作是:
1.关闭我的IDE
1.转到我的项目目录
1.搜索并删除所有. lock文件
1.打开IDE,然后重试
zsbz8rwp6#
请重新启动您的计算机。这是一个与缓存相关的错误