java
build_error
ai_generated
true
在项目 ':app' 中未找到任务 'deploy'。可用任务:assemble, build, clean, jar, test, ...
Task 'deploy' not found in project ':app'. Available tasks: assemble, build, clean, jar, test, ...
ID: java/gradle-missing-task-definition
80%修复率
85%置信度
0证据数
2025-10-20首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| 7+ | active | — | — | — |
根因分析
构建脚本中未定义 'deploy' 任务,或者该任务定义在未包含的子项目中。
English
The 'deploy' task is not defined in the build script or is defined in a subproject that is not included.
解决方案
-
95% 成功率 Define the 'deploy' task in the build script
task deploy { doLast { println 'Deploying...' } } -
90% 成功率 Check the available tasks and use an existing one like 'publish'
gradle tasks --group build
无效尝试
常见但无效的做法:
-
Creating a custom task with the same name but no implementation
80% 失败
The task will do nothing and may cause confusion.
-
Running the task in a different subproject
70% 失败
The task may not exist there either, or it may be the wrong one.