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'".
> 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
- Run
./gradlew tasks --allto see registered tasks and their paths. - Correct the spelling, or qualify the task with its subproject path.
- Re-run with the exact task path.
./gradlew tasks --all
./gradlew :app:assembleReleaseApply 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.
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 tasksafter changing plugins to confirm task names.