Gradle同步失败:无法为锁定文件创建父目录 [英] Gradle sync failed: Could not create parent directory for lock file

查看:2617
本文介绍了Gradle同步失败:无法为锁定文件创建父目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在android studio中签出了一个git存储库,但遇到了 Gradle sync failed 错误.

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

当项目要构建时,android studio会引发如下错误:

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:\Users\Mohammad\.gradle\wrapper\dists \gradle-4.10.1- 
all\455itskqi2qtf0v2sja68alqd\gradle-4.10.1-all.zip.lck

  • 我看到了其他几乎相同的问题的答案,但是没有一个 他们会帮忙.
  • 我还根据上述路径删除了.gradle目录中的现金,但是它不起作用.
    • 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.

      推荐答案

      我找到了这个答案:

      1. 在android studio的右上角,点击Gradle工具, 然后右键单击your project name,然后单击Refresh Gradle project,如下所示:
      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:

      1. 然后单击Build -> Rebuild Project,如下所示:
      1. Then click on the Build -> Rebuild Project as following:

      这篇关于Gradle同步失败:无法为锁定文件创建父目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆