Gradle 同步失败访问在 android studio 中被拒绝 [英] Gradle sync failed access is denied in android studio

查看:43
本文介绍了Gradle 同步失败访问在 android studio 中被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以向我解释这个错误是什么以及如何解决这个错误吗?

Can someone please explain to me what this error is and how to resolve this error?

Gradle 同步失败:D:\SoundsandPictures.gradle\4.4\fileHashes\fileHashes.lock(访问被拒绝)

Gradle sync failed: D:\SoundsandPictures.gradle\4.4\fileHashes\fileHashes.lock (Access is denied)

注意:我的项目在 D: 驱动器上,我不小心删除了驱动器上的所有数据,并使用恢复软件将其恢复,并在 android studio 中打开项目时出现此错误.

Note: My project was on D: drive and i accidently deleted all my data on the drive and recovered it using a recovery software and getting this error while opening the project in android studio.

推荐答案

Goto File -> Invalidate caches/Restart

Goto File -> Invalidate caches / Restart

关闭 Android Studio

Shutdown Android Studio

重命名/删除用户主目录中的 .gradle 文件夹

Rename/remove .gradle folder in the user home directory

重启Android Studio(它将下载gradle元数据和数据)

Restart Android Studio (It will download gradle metadata and data)

Gradle 构建成功

Gradle build succeed

重建项目.完成.

编辑

在 Mac OS 上试试这个

Try this for Mac OS

进入 SDK 管理器(具有管理员权限),向下滚动到最后,下载Android 支持库".

Go to SDK manager (with Administrator rights), scroll down till the end, download "Android Support Library".

它可以工作(不要忘记管理员权限).

And it works (don't forget Administrator rights).

参考 this SO 问题..

Reference this SO Question..

这篇关于Gradle 同步失败访问在 android studio 中被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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