Skip to content
Latchkey

Gradle "Task 'X' not found in root project" in CI

Gradle parsed the command line, looked for the named task on the target project, and found nothing by that name. The task may be misspelled, defined only in a subproject, or contributed by a plugin that did not apply.

What this error means

The build fails with "Task 'assembleRelase' not found in root project 'app'. Some candidates are: 'assembleRelease'." or "Cannot locate tasks that match ':X'".

Gradle
> Task 'assembleRelase' not found in root project 'app'.
  Some candidates are: 'assembleRelease'.

Common causes

A misspelled task name

The invoked name does not match any registered task; Gradle suggests the closest candidates it knows.

The task lives in a subproject or a plugin that did not apply

The task is defined under :module: rather than the root, or the plugin that registers it was not applied, so it is absent at the path you asked for.

How to fix it

List the real task names

  1. Run ./gradlew tasks --all to see registered tasks and their paths.
  2. Correct the spelling, or qualify the task with its subproject path.
  3. Re-run with the exact task path.
Terminal
./gradlew tasks --all
./gradlew :app:assembleRelease

Apply the plugin that contributes the task

If the task should exist but does not, ensure the plugin that registers it is applied in the right project.

build.gradle.kts
plugins { id("com.android.application") }

How to prevent it

  • Reference tasks by their full path in CI scripts.
  • Keep task names in CI in sync when build logic is refactored.
  • Run ./gradlew tasks after changing plugins to confirm task names.

Frequently asked questions

What causes ""Task 'X' not found in root project""?
The invoked name does not match any registered task; Gradle suggests the closest candidates it knows.
How do I fix "Task 'X' not found in root project"?
List the real task names

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card