fix: build Android against the devbox-managed JDK and NDK

This commit is contained in:
randogoth 2026-10-12 08:17:49 +03:00
parent 8426818712
commit ac998b394d
5 changed files with 35 additions and 2 deletions

View file

@ -19,6 +19,25 @@ subprojects {
project.evaluationDependsOn(":app")
}
// The devbox-managed SDK ships one NDK and is read-only, so Gradle can never
// install another beside it. Plugin build scripts ask for Flutter's default
// NDK, which the SDK does not carry; every project is therefore pinned to
// the one it does. Matches the app's own pin in app/build.gradle.kts.
gradle.afterProject {
// The devbox-managed SDK ships one NDK and is read-only, so Gradle can
// never install another beside it. Plugin build scripts ask for
// Flutter's default NDK, which the SDK does not carry; every project
// is therefore pinned to the one it does, as the app itself is.
val android = extensions.findByName("android") ?: return@afterProject
try {
android::class.java
.getMethod("setNdkVersion", String::class.java)
.invoke(android, "27.0.12077973")
} catch (_: NoSuchMethodException) {
// Nothing to pin.
}
}
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}