Gradle sync failed access is denied in android studio

后端 未结 9 2156
南旧
南旧 2021-01-02 11:09

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

Gradle sync failed: D:\\SoundsandPictures.gradle\\4.4\\fileHashes\\

相关标签:
9条回答
  • 2021-01-02 11:45

    Goto File -> Invalidate caches / Restart

    Shutdown Android Studio

    Rename/remove .gradle folder in the user home directory

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

    Gradle build succeed

    Rebuild project. Done.

    EDIT

    Try this for Mac OS

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

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

    Reference this SO Question..

    0 讨论(0)
  • 2021-01-02 11:47

    i deleted the file, then appear another message but with other file, i did the same 3 times, and then a clean and rebuild and worked. PS: those files regenerate after the build, so no problem there.

    0 讨论(0)
  • 2021-01-02 11:50

    /.gradle/4.6/fileChanges/last-build.bin%20(Access%20is%20denied)

    I resolved this issue by deleting .gradle folder and then restart android studio clean and rebuild

    0 讨论(0)
  • 2021-01-02 11:54

    OK.. To solve this issue, simple navigate to your project folder like C:\Users\AndroidStudioProjects\Project.gradle\taskArtifacts folder and delete the file. The fileHashes.lock is holding a global lock and is preventing you from running your script. Deleting the folder would create the file again and your project will get built. Also there is a possibility that there are other locked files. Simply delete everything within the C:\Users\Administrator.gradle\caches folder.

    0 讨论(0)
  • 2021-01-02 12:03

    Create a new Android project and move all your recovered files into it. This issue you are facing is because of existing settings in the old project.

    Then ...

    Go to File--> Project Structure --> Check Use Embedded JDK (Recommended)

    0 讨论(0)
  • 2021-01-02 12:06

    In my case, I hid the .gradle file. On unhiding the file, it was fine.

    0 讨论(0)
提交回复
热议问题