Yog
Yog

Reputation: 825

Gradle sync failing

Gradle sync failed:

Timeout waiting to lock file hash cache (C:\Users\HELLO\.gradle\caches\4.1\fileHashes). It is currently in use by another Gradle instance.
Owner PID: 10116
            Our PID: 7136
            Owner Operation: 
            Our operation: 
            Lock file: C:\Users\HELLO\.gradle\caches\4.1\fileHashes\fileHashes.lock
            Consult IDE log for more details (Help | Show Log) (1m 23s 517ms)

-> Gradle build is failing -> Unable to delete filehash lock file. It throws file in use

Upvotes: 1

Views: 2896

Answers (3)

Himanshu Saxena
Himanshu Saxena

Reputation: 41

To handle this problem go through the following points.

  1. Invalidate catch and and restart studio
  2. If not work yet than Restart your computer
  3. Go to file directory Restart your computer C:\Users\AdminUser .gradle\caches\4.1\fileHashes\ and delete filehash.lock
  4. Now Restart your Studio it would work fine

Upvotes: 4

AAryan
AAryan

Reputation: 20140

Delete everything under below path.

C:\Users\HELLO\.gradle\caches\ 

There is a fileHashes.lock that is holding a global lock which is preventing you from running your script.

Upvotes: 0

Yog
Yog

Reputation: 825

Go to .gradle directory and delete all files in caches

Sometimes it was notable to delete filehash.lock file and it will throw an error unable to delete file. So do the following steps

For Windows machine:

Open Task Manager(Ctrl-Alt-Delete and check Process)

-> If you run two instance of android studio, Close One (End Task)

-> Then close OpenJDK Platform Binary

-> Gradle sync now on AndroidStudio and it will work now

Upvotes: 2

Related Questions