// Some legacy Flutter plugins (notably agora_rtc_engine 6.5.x) read // `rootProject.ext.compileSdkVersion` via the old Groovy `safeExtGet` helper, // defaulting to 31 if unset. We force 34 here so they satisfy androidx // fragment 1.7.1's "compile against 34+" requirement. extra["compileSdkVersion"] = 36 extra["targetSdkVersion"] = 34 extra["minSdkVersion"] = 24 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) } // Override compileSdk for every Android subproject (Flutter plugins) so they // satisfy androidx.fragment 1.7.1's "compile against 34+" requirement. The // agora_rtc_engine plugin declares compileSdk=31 internally; this hook bumps // every plugin to 34 without us having to fork them. Must be configured // BEFORE the `evaluationDependsOn(":app")` line below — otherwise the plugin // projects are already evaluated and afterEvaluate throws. subprojects { plugins.withId("com.android.library") { extensions.configure(com.android.build.gradle.LibraryExtension::class.java) { compileSdk = 36 } } plugins.withId("com.android.application") { extensions.configure(com.android.build.gradle.AppExtension::class.java) { compileSdkVersion(36) } } } subprojects { project.evaluationDependsOn(":app") } tasks.register("clean") { delete(rootProject.layout.buildDirectory) }