复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-ecc-999604267aa4 ,按照其中的说明把「gradle-build」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Incrementally fix Gradle build and compilation errors for Android and Kotlin Multiplatform projects.
Identify the project type and run the appropriate build:
| Indicator | Build Command |
|---|---|
build.gradle.kts + composeApp/ (KMP) | ./gradlew composeApp:compileKotlinMetadata 2>&1 |
build.gradle.kts + app/ (Android) | ./gradlew app:compileDebugKotlin 2>&1 |
settings.gradle.kts with modules | ./gradlew assemble 2>&1 |
| Detekt configured | ./gradlew detekt 2>&1 |
Also check gradle.properties and local.properties for configuration.
For each error:
build.gradle.ktsStop and ask the user if:
Report:
| Error | Fix |
|---|---|
Unresolved reference in commonMain | Check if the dependency is in commonMain.dependencies {} |
| Expect declaration without actual | Add actual implementation in each platform source set |
| Compose compiler version mismatch | Align Kotlin and Compose compiler versions in libs.versions.toml |
| Duplicate class | Check for conflicting dependencies with ./gradlew dependencies |
| KSP error | Run ./gradlew kspCommonMainKotlinMetadata to regenerate |
| Configuration cache issue | Check for non-serializable task inputs |