gradlelocking

Cannot lock file hash cache when gradle was aborted


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.

Solution

  • 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.