Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'gradlew' is not recognized as an internal or external command error in Android Studio terminal

Getting error - 'gradlew' is not recognized as an internal or external command. operable program or batch file. inside Android Studio terminal.

Can anyone please tell why it's not recognizing gradlew

like image 492
Shirish Herwade Avatar asked Mar 14 '18 07:03

Shirish Herwade


4 Answers

  1. gradlew command is available in your project directory. If you are trying to run this command from somewhere else it will throw error.
  2. Also gradlew command package is automatically generated by Android studio when you create a new project. It will also prompt you to generate new gradle wrapper when you open the project.
  3. you have to use ./gradlew instead of gradlew , if you are using Mac or Linux
like image 137
charlie Avatar answered Sep 19 '22 12:09

charlie


It's under the Android folder, so you have to do cd Android first from your project root folder, then :

PS C:\code\my_app\android> ./gradlew signingReport
like image 33
live-love Avatar answered Sep 16 '22 12:09

live-love


Assume that you app's name is video_compresser, so when you open terminal on Windows PC(because I am trying this on Windows) it shows the prompt like this.

C:\Users\Nuwan\StudioProjects\video_compresser>

If you run gradlew from here you will get the below message

'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 the prompt should be like this,

C:\Users\Nuwan\StudioProjects\video_compresser\android>

then type gradlew followed by other commands you need and the error should be gone.

like image 37
Nuwan Thisara Avatar answered Sep 17 '22 12:09

Nuwan Thisara


Try using, ./gradle clean ./gradle assembleRelease worked for me.

like image 43
Anshul Borawake Avatar answered Sep 16 '22 12:09

Anshul Borawake