Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradlew: Permission Denied

I am attempting to run gradlew from my command line, but am constantly facing the following error.

Brendas-MacBook-Pro:appx_android brendalogy$ ./gradlew compileDebug --stacktrace -bash: ./gradlew: Permission denied 

I am already running this command from my project directory. Need to run this command as I am facing the same (nondescriptive) error on Android Studio 0.2.x as encountered here: Android studio and gradle build error

Am I doing something wrong and how do I get around this?

like image 705
Brenda Nicole Tan Avatar asked Jul 16 '13 04:07

Brenda Nicole Tan


People also ask

Do I need Gradle to run gradlew?

you don't need to have Gradle installed on your machine to build the project. the wrapper guarantees you'll be using the version of Gradle required by the project. you can easily update the project to a newer version of Gradle, and push those changes to version control so other team members use the newer version.

How do I run gradlew on Windows?

To run a Gradle command, open a command window on the project folder and enter the Gradle command. Gradle commands look like this: On Windows: gradlew <task1> <task2> … ​ e.g. gradlew clean allTests.

What is the gradlew file?

Overview. Gradle is commonly used by developers to manage their project's build lifecycle. It's the default choice of build tool for all new Android projects.

What is gradlew Android Studio?

You can execute all the build tasks available to your Android project using the Gradle wrapper command line tool. It's available as a batch file for Windows ( gradlew. bat ) and a shell script for Linux and Mac ( gradlew.sh ), and it's accessible from the root of each project you create with Android Studio.


2 Answers

Try to set the execution flag on your gradlew file:

chmod +x gradlew

like image 54
Vincent Cantin Avatar answered Sep 19 '22 05:09

Vincent Cantin


Could also be fixed with

git update-index --chmod=+x gradlew 
like image 38
user1921819 Avatar answered Sep 21 '22 05:09

user1921819