# 未找到设置文件 'settings.gradle'。请创建一个，或从根项目目录运行 Gradle。

- **ID:** `java/gradle-missing-settings-file`
- **领域:** java
- **类别:** build_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

Gradle 期望在项目根目录中存在 settings.gradle 文件以定义项目结构。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 7+ | active | — | — |

## 解决方案

1. **Create a settings.gradle file with the project name** (95% 成功率)
   ```
   rootProject.name = 'my-app'
   ```
2. **Include subprojects if applicable** (90% 成功率)
   ```
   rootProject.name = 'my-app'
include 'subproject-a', 'subproject-b'
   ```

## 无效尝试

- **Running Gradle from a subdirectory without a settings file** — Gradle cannot determine the project structure without a settings file. (90% 失败率)
- **Creating an empty settings.gradle file** — An empty file may be accepted, but it will not include any subprojects, which may be needed. (50% 失败率)
