Gradle looks for the wrapper task inside the app module
Task 'wrapper' not found in project ':app'Short answer
The wrapper task exists only on the root project. The error means Gradle was told to run it on a subproject such as :app. Address it with a leading colon from the project root, and if gradlew does not exist yet, generate the files once with an installed Gradle.
Fix it fast
1Find out which cause you have
Find the folder that holds settings.gradle(.kts) and gradlew. The command must start there, not in the app folder.
ls settings.gradle* gradlew gradle/wrapper2Match what you see, then jump to its fix
What does the error look like?
Task 'wrapper' not found in project ':app'
Cause 1 of 2
The command targets the app subproject
1Check
The wrapper files live only in the root directory, and the task is meaningful only on the root project. Check which folder you are in.
pwd && ls2Fix
Go to the root and call the task with the leading colon, which targets the root project.
cd ..
./gradlew :wrapper --gradle-version latest3Verify
Print the version the wrapper now uses.
./gradlew --versionConfirmed by docs.gradle.org
Cause 2 of 2
There is no wrapper yet, so you want to create one
1Check
The wrapper is generated by the wrapper task of an installed Gradle, or by gradle init for a new project.
gradle --version2Fix
Run the task on the root project with an installed Gradle and commit the generated files. A second run updates gradlew and the jar when you change the version.
gradle :wrapper
./gradlew :wrapper --gradle-version latest3Verify
gradlew now exists and starts.
./gradlew --versionConfirmed by docs.gradle.org
How do I stop it coming back?
- Commit gradlew, gradlew.bat and the gradle/wrapper folder with the project.
- Run wrapper upgrades from the root folder, then confirm with ./gradlew --version.
- From a subproject folder, call the root script by relative path (for example ../gradlew) instead of installing another Gradle.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Mobile apps
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile apps
adb tcpip 5555 fails because no device is found
adb: more than one device/emulator
adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.
4 causes, each with a fixMobile apps
The Android Emulator says /dev/kvm is not found
KVM acceleration can NOT be used
The emulator wants a hypervisor and cannot find one.
4 causes, each with a fixMobile apps
The emulator says the GPU driver is unsupported and falls back to software
vulkan-1.dll cannot be found
The emulator picks a graphics mode when it starts.
4 causes, each with a fix