From 29823f97e08629f76ed4950f1be35631caa1c231 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 18 Aug 2024 03:18:19 +0800 Subject: [PATCH] android: build: Force all subprojects to use compileSdkVersion 34 Force all subprojects to use compileSdkVersion 34 to resolve resource linking error during APK release build Added a `subprojects` block in `android/build.gradle` to ensure all subprojects are compiled with `compileSdkVersion 34`. This temporary workaround addresses the `android:attr/lStar` resource linking issue when building the release APK. The block is placed before the existing `subprojects` configuration to avoid evaluation errors. https://github.com/flutter/flutter/issues/153281#issuecomment-2291115797 --- src/ui/flutter_app/android/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ui/flutter_app/android/build.gradle b/src/ui/flutter_app/android/build.gradle index 18437ee736..16497cb468 100644 --- a/src/ui/flutter_app/android/build.gradle +++ b/src/ui/flutter_app/android/build.gradle @@ -6,6 +6,16 @@ allprojects { } rootProject.buildDir = '../build' +subprojects { + afterEvaluate { project -> + if (project.plugins.hasPlugin("com.android.application") || + project.plugins.hasPlugin("com.android.library")) { + project.android { + compileSdkVersion 34 + } + } + } +} subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" project.evaluationDependsOn(':app')