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
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
./gradlew
instead of gradlew , if you are using Mac or LinuxIt'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
in vscode do this step
./gradlew
in your terminal instead of gradlewTry using,
./gradle clean
./gradle assembleRelease
worked for me.
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.
make sure you have debug.keystore file in
PS C:\code\my_app\android>
before you run
./gradlew signingReport
Instead of the powershell, use the Windows Command Prompt to run the command.
(This is an accidental finding. I used the visual studio code terminal to run the command gradlew assembleRelease
to build the apk of a react-native project, but it outputs an error similar to above. I tried bash terminal, again failed to run. Out of curiosity, I used the Windows command prompt, then it worked. Hope this will help if other solutions are not working).
If you use powershell, and the gradlew file is in the terminal current work directory, try .\gradlew instead of gradlew. Powershell don't run the command in the current work directory automatically.
go to android directory by typing "cd android" in terminal.
then the prompt should be like this, PS C:\src\offx> cd android PS C:\src\offx\android>
(//then type) ".\gradlew signinReport" PS C:\src\offx\android> .\gradlew signinReport
Then you will get your sha keys
ionic cordova build android --prod --release --alias=cos-android --password=abcd --versionCode=00001 --versionName=00001 -- -- -- --packageType=bundle
cordova build android --prod --release --alias=cos-android --password=abcd --versionCode=00001 --versionName=00001 -- -- --packageType=bundle
gradlew command is only available in your project directory or gradlew file location. If you are trying to run this command from somewhere else it will throw error. so go to that particular location where gradlew file available
Try running
./gradlew signingreport
I didn't have JDK installed so, you have to do that as well if you see something like: "No JDK set and/or no java in path to be found". After installing JDK just close and open again Android Studio and do
./gradlew signingreport
once more. You should be fine by now.
In case of using Flutter for to project folder under gradle folder and run the command .\gradlew
If You Are Facing this error
Do This
in Your project Folder
cd android
./gradlew
./gradlew clean
Perfectly Working
gradlew
didn't work on my computer, though I'm a Windows user. ./gradlew
is worked successfully.
I got the same error while working on a react native project in vs code when I wrote ./gradlew clean
.
I just changed the forward slash ( / ) to backslash ( \ ) and it worked.
try using these commands, command No1: (cd android) command No2: (./gradlew clean) without brackets offcourse
I am using windows OS and have to run a Java project in IntelliJ. I used the command prompt in admin mode then it worked for me.
© 2022 - 2025 — McMap. All rights reserved.
gradlew clean && gradlew assembleRelease
instead ofgradlew.BAT clean && gradlew.BAT assembleRelease
– Wessel./gradle clean && ./gradle assembleRelease
worked for me. – Unconscious