Gradlew not found (no such file or directory)

I download a project from git and create it on a MacBook. When I type "./gradlew assembleRelease" in the terminal window, I get an error message:

bash: ./gradlew: No such file or directory 

So, I check if gradlew is in the project directory, but I can not find it. But I can still start the task from the Gradle projects window.

What's wrong?

+6
source share
2 answers

gradlew script is the so-called gradle shell, a stand-alone script that allows people to run gradle tasks withoiut gradle. Hovewer does not exist to exist for gradle tasks, it is absolutely optional.

You can create a Wrapper in your project by completing the task

 gradle wrapper 

Subsequently, you can use the ./gradlew script instead of gradle from PATH

To indicate the use of the gradle version, gradle is the command line version. Just run the command:

 gradle wrapper --gradle-version <your gradle version> 

If something else is unclear, you can find the answers here https://docs.gradle.org/current/userguide/gradle_wrapper.html

+7
source

Add run permission for all users to existing permissions

 chmod +x gradlew 
+1
source

Source: https://habr.com/ru/post/1013662/


All Articles