Pin Flutter 3.47.0 (Dart 3.13) as the CI source of truth and move the Android toolchain to the 3.47 template versions: Gradle 9.3.1, AGP 9.1.0, Kotlin 2.4.0. App Gradle script matches the 3.47 template (drop kotlin-android / kotlinOptions, use compilerOptions). Keep android.builtInKotlin=false and android.newDsl=false so plugins that still apply KGP keep building. AGP 9 requires libraries to compile against their dependencies' compileSdk; force plugin modules to 36 via finalizeDsl. Ignore android/build/, which AGP 9 now writes a problems report into. analyze, test, and a release APK all passed. 16 KB zip alignment verified. iOS UIScene is not in this commit: AppDelegate is customized (CookieExtractorPlugin), so Flutter will not auto-migrate.
37 lines
1 KiB
Kotlin
37 lines
1 KiB
Kotlin
import com.android.build.api.variant.LibraryAndroidComponentsExtension
|
|
|
|
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
val newBuildDir: Directory =
|
|
rootProject.layout.buildDirectory
|
|
.dir("../../build")
|
|
.get()
|
|
rootProject.layout.buildDirectory.value(newBuildDir)
|
|
|
|
subprojects {
|
|
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
|
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
|
}
|
|
subprojects {
|
|
project.evaluationDependsOn(":app")
|
|
}
|
|
|
|
// AGP 9 requires each library to compile against at least the compileSdk of
|
|
// its dependencies. Several Flutter plugins still pin compileSdk 33/34.
|
|
// finalizeDsl runs after the plugin's android {} block. Does not change minSdk.
|
|
subprojects {
|
|
pluginManager.withPlugin("com.android.library") {
|
|
extensions.configure<LibraryAndroidComponentsExtension>("androidComponents") {
|
|
finalizeDsl { it.compileSdk = 36 }
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register<Delete>("clean") {
|
|
delete(rootProject.layout.buildDirectory)
|
|
}
|