Reputation: 526
I just get "Permission Denied" issue after reinstalling android studio 1.2.2 on my MAC OS X Yosemite 10.10.3.
I can build the android code in terminal by adding sudo
in the beginning of gradle command. e.g. sudo gradle build
or sudo ./gradlew build
. However, even though I have successfully built the android app using terminal,it does seem annoying to me that I can't use the android studio as the yellow warning pop up to me (see screenshots)
I have tried running the android Studio in root mode, but no luck.
sudo /Applications/Android Studio.app/Contents/MacOS/studio
In addition, I have also tried the solution by providing the executable mode for gradle files. I have added chmod +x gradlew
in project directory (as you can see in the screenshot) and in studio directory at /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1
Does anyone have any idea how to fix the gradle permission denied in Android Studio 1.2.2?
Upvotes: 2
Views: 9198
Reputation: 136
you need to go to your project folder and right click. Then go to 'Get Info' a pop up appears. Then go down to a small lock on your right and click it. If asked for a password enter it and give permission. Then go back to the pop up and look for your name, click your name and and then look for a small * and next to it you will find a dropdown. Click it and it will open 'Apply to enclosed items'. Click it to give access and permission to your project. After that go to Android Studio and close your project and then restart Android Studio and run your project. The error should be gone, that is how I solved my problem too.
Upvotes: 1
Reputation: 761
Just add x permission to gradlew file in your project folder. Like this:
chmod +x gradlew
Upvotes: 11
Reputation: 526
I have managed to solve it.
Just remove the .gradle
directory rm -fr .gradle
in /Users/YOUR_NAME/.gradle
. Then, execute the android studio in root mode.
Upvotes: 4