Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle sync failed access is denied in android studio

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\fileHashes.lock (Access is denied)

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.

like image 660
danish Avatar asked Jun 22 '18 16:06

danish


1 Answers

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..

like image 173
amit Avatar answered Sep 28 '22 06:09

amit