Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio terminal doesn't recognize gradle as a command

I have Android Studio and its build tool is Gradle. However, inside the Android Studio Terminal (not the windows cmd..) if i type

gradle tasks

I get

'gradle' is not recognized as an internal or external command,
operable program or batch file.

How is that possible?
If Android Studio is using gradle then isn't gradle installed already?
to add more confusion, when I look at C:\Program Files I don't see a gradle folder at all.
How does Android Studio and Gradle work together?

thanks

like image 780
user3355139 Avatar asked Apr 29 '17 08:04

user3355139


People also ask

How do I run gradlew in terminal?

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.

Is not recognized as an internal or external command gradlew clean?

'gradlew' is not recognized as an internal or external command, operable program or batch file. so you have to go to android directory by typing cd android command from terminal. then type gradlew followed by other commands you need and the error should be gone.

How do I know if Gradle is installed?

To check if Gradle is properly installed just type gradle -v. The output shows the Gradle version and also the local environment configuration (groovy and JVM version, etc.). The displayed Gradle version should match the distribution you have downloaded.


1 Answers

On Windows you have to use the gradlew command (it uses the gradlew.bat in the root project folder).

On Linux and Mac you have to use the gradle command.

like image 129
Gabriele Mariotti Avatar answered Oct 31 '22 02:10

Gabriele Mariotti