1

Gradle Error : Could not create parent directory for lock file.

Could not create parent directory for lock file D:\PROGRAM FILES\ANDROID\jbr\wrapper\dists\gradle-7.5-bin\f1w0cc9nuo0eivz97x2xlu9sv\gradle-7.5-bin.zip.lck

While building or syncing my app, the Gradle shows this error.

Please help me with this error.

1
  • Try reboot, delete that .lck file, and try again
    – Ken Wolf
    Commented Mar 13, 2023 at 15:25

2 Answers 2

17

Make your Gradle User Home to be empty Make your Gradle User Home to be empty

Then restart Android Studio and sync. Gradle error will be gone.

2
  • 1
    Finally a correct answer, thanks! I wonder how that ended up as '/sdk' for me, this is a new installation. Commented Oct 5, 2023 at 5:09
  • I had this problem, seemingly randomly, and your answer fixed it for me, thank you. I think it could have been caused by the Upgrade Assistant, which crashed.
    – BenHerbert
    Commented Apr 18 at 13:26
2

As it was already said - make your "Gradle User Home" setting empty.

How to find the setting in Android Studio Hedgehog | 2023.1.1:

Android Studio Hedgehog | 2023.1.1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.