fix: build Android against the devbox SDK and current Flutter

This commit is contained in:
randogoth 2026-10-13 11:47:01 +03:00
parent 722390ecec
commit 414f8e8484
5 changed files with 26 additions and 16 deletions

View file

@ -8,16 +8,17 @@ plugins {
android {
namespace = "vision.flux.muzzlevelocity"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileSdkVersion 34
// The devbox-managed SDK ships this NDK and is read-only, so Gradle
// cannot install the Flutter default beside it.
ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_17
}
defaultConfig {

View file

@ -13,6 +13,15 @@ subprojects {
project.evaluationDependsOn(":app")
}
// Plugin build scripts ask for Flutter's default NDK, which the read-only
// devbox-managed SDK does not carry, so every project gets the app's pin.
gradle.afterProject { project ->
def android = project.extensions.findByName("android")
if (android != null && android.hasProperty("ndkVersion")) {
android.ndkVersion = "27.0.12077973"
}
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

View file

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip

View file

@ -18,8 +18,8 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.2.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "com.android.application" version "8.11.1" apply false
id "org.jetbrains.kotlin.android" version "2.2.20" apply false
}
include ":app"