Cannot lock file hash cache when gradle was aborted

Viewed 17788

I canceled a running Gradle build and now I get the following message whenever I restart it:

Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
   > Cannot lock file hash cache (/data/.gradle/6.4.1/fileHashes) as it has already been locked by this process.
3 Answers

try running (if gradle in installed on your machine and in the PATH)

gradle --stop

or

./gradlew --stop

in your project directory from the command line. worked for me.

run

gradlew --stop 

in the terminal for Windows

For Mac user run

./gradlew --stop 

from root of you project

The solution is to look for the gradle process and to kill it. In my case I had to look for a running java process.

So in htop I searched for java and terminated it. That solved my problem.

Related