Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Gradle looks for the wrapper task inside the app module

ErrorTask '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.

  • Applies to Gradle 8.x and 9.x, Android Studio current stable, Linux and macOS
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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/wrapper
  2. 2Match what you see, then jump to its fix

    1. 1You typed :app:wrapper, or you ran the command from inside the app folder and the error names ':app'The command targets the app subprojectFix
    2. 2gradlew: No such file or directory, or gradle/wrapper is missingThere is no wrapper yet, so you want to create oneFix

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 && ls

2Fix

Go to the root and call the task with the leading colon, which targets the root project.

cd ..
./gradlew :wrapper --gradle-version latest

3Verify

Print the version the wrapper now uses.

./gradlew --version

Confirmed by docs.gradle.org

Did this fix it?

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 --version

2Fix

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 latest

3Verify

gradlew now exists and starts.

./gradlew --version

Confirmed by docs.gradle.org

Did this fix it?

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 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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.