Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

android - Gradle sync failed: Could not create parent directory for lock file

I checked out a git repository in android studio, but I'm in trouble with Gradle sync failed error.

When project wants to build, the android studio raise an error like as following:

Gradle sync failed: Could not create parent directory for lock file 
C:Usersusername.gradlewrapperdists gradle-4.10.1- 
all455itskqi2qtf0v2sja68alqdgradle-4.10.1-all.zip.lck
  • I saw some answers to the other almost same problems, but none of them help.
  • Also I deleted cashes in .gradle directory according above path, but it does not work.

How can I solve this problem?

I appreciate you to solve this problem, thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I found this answer:

  1. In the upper-right corner of android studio click on the Gradle tool, then right click on the your project name then click on the Refresh Gradle project as following:

Gradle --> Your project name --> Refresh Gradle project

  1. Then click on the Build -> Rebuild Project as following:

Build --> Rebuild Project


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...