I am working on a Java project with gradlew. I use Ubuntu Linux as my OS. When I run "gradle" it runs, and gives me info. But when I run "gradlew", it outputs as "No command 'gradlew' found, did you mean: Command 'gradle' from package 'gradle' (universe) gradlew: command not found"
I did my research, I have jdk, and I did sudo apt-get install gradle. I am totally clueless
If you are using VS Code with flutter, you should find it in your app folder, under the android folder:
You can run this in the terminal:
If you are using mac, try giving root access to gradlew by doing
chmod +x ./gradlew
For Ubuntu(linux) users:
"bash ./gradlew build " works
./gradlew build " doesnot work.
For me the issue was it was on NTFS file system, linux does not let execute a script from NTFS.
Try moving the code from NTFS to a linux partition.
./gradlew build should work
If the answer marked as correct does not work, it is because you need to identify yourself as a super user.
sudo gradle wrapper --gradle-version 2.13
It worked for me.
You must have the Gradle wrapper available locally before using
gradlew. To construct that
gradle wrapper # --gradle-version v.xy
Optionally, pass the gradle version explicitly. This step produces the gradlew binary.And then you should be able to
I use intellj idea and in windows in terminal type:
it is working for me.
Nothing is working except the following command
chmod 777 gradlew Then
As noted in the comments, just running
worked for me. Adding the
./ tells it to look in the current directory since it isn't in the path.
In addition is @suraghch
Linux / MacOS ./gradlew clean
Windows PowerShell .\gradlew clean
Windows cmd gradlew clean
First thing is you need to run the gradle task that you mentioned for this wrapper. Ex :
gradle wrapper After running this command, check your directory for gradlew and gradlew.bat files. gradlew is the shell script file & can be used in linux/Mac OS. gradlew.bat is the batch file for windows OS. Then run,
./gradlew build (linux/mac). It will work.
the same problem occurs to me...
I check the file wrx permissions with:
$ls -l ./gradlew -> -rw-rw-r-- (no execute permission)
so I use command
$chmod +x ./gradlew and this problem solved.
Running this bash command works for me by running
chmod 755 gradlew as sometimes file properties changed upon moving from one OS to another (Windows, Linux and Mac).
Hi @Hayden Stites I faced the same issue, but after some tries I found it was happening because I was trying to create build in git bash , instead of CMD with admin access. If you create build with Command prompt run as administrator build will get create.