From 132961cce0858afdd181226e665ef39b295db55d Mon Sep 17 00:00:00 2001 From: MuZhou233 Date: Mon, 23 Sep 2024 00:35:37 +0800 Subject: [PATCH] fix: fix native_flutter_proxy --- android/build.gradle | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index bc157bd..bdba441 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,11 +6,31 @@ allprojects { } rootProject.buildDir = '../build' +//https://github.com/flutter/flutter/issues/153281 subprojects { + afterEvaluate { project -> + if (project.extensions.findByName("android") != null) { + Integer pluginCompileSdk = project.android.compileSdk + if (pluginCompileSdk != null && pluginCompileSdk < 31) { + project.logger.error( + "Warning: Overriding compileSdk version in Flutter plugin: " + + project.name + + " from " + + pluginCompileSdk + + " to 31 (to work around https://issuetracker.google.com/issues/199180389)." + + "\nIf there is not a new version of " + project.name + ", consider filing an issue against " + + project.name + + " to increase their compileSdk to the latest (otherwise try updating to the latest version)." + ) + project.android { + compileSdk 31 + } + } + } + } + project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') + project.evaluationDependsOn(":app") } tasks.register("clean", Delete) {