Files
Dat H. Pham 914dabeec2 HOTFIX Fix Android release build failing in R8
Since file_picker 13, the android_file_picker plugin sorts before "app",
so the root subprojects loop evaluated :app before redirecting its build
dir. Flutter then registered AGP's default proguard-android-optimize.txt
under android/app/build, a path that never exists, and R8 silently
dropped it. Without its -dontwarn androidx.** rule, minifyReleaseWithR8
fails on Compose classes referenced by Sentry session replay.

Set every build dir first, then force :app evaluation.
2026-10-14 08:46:05 +07:00

46 lines
1.2 KiB
Groovy

allprojects {
repositories {
google()
mavenCentral()
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
project.android {
if (namespace == null) {
namespace project.group
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
compileSdk 36
}
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
}
rootProject.buildDir = '../build'
// Redirect every build dir before forcing :app evaluation. Otherwise a plugin sorting
// before "app" evaluates :app early and R8 loses the default rules file path.
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}