Gradle Timeout waiting to lock file

$ gradle clean
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type FileHasher using GradleUserHomeScopeServices.createCachingFileHasher().
> Timeout waiting to lock file hash cache (/Users/***/.gradle/caches/5.2.1/fileHashes). It is currently in use by another Gradle instance.
  Owner PID: 9193
  Our PID: 10083
  Owner Operation: 
  Our operation: 
  Lock file: /Users/***/.gradle/caches/5.2.1/fileHashes/fileHashes.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 13s


FAILURE: Build failed with an exception.

* What went wrong:
Could not create service of type FileAccessTimeJournal using GradleUserHomeScopeServices.createFileAccessTimeJournal().
> Timeout waiting to lock journal cache (/Users/***/.gradle/caches/journal-1). It is currently in use by another Gradle instance.
  Owner PID: 9193
  Our PID: 10083
  Owner Operation: 
  Our operation: 
  Lock file: /Users/***/.gradle/caches/journal-1/journal-1.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 0s

上面的报错可以通过下面的命令解决:
find ~/.gradle -type f -name "*.lock" | while read f; do rm $f; done

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容