Skip to content

Commit

Permalink
Add workaround for APK builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandgeider committed Nov 9, 2024
1 parent 357b7c1 commit e91d296
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,37 @@ rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}

// Workaround for APK builds - 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
}
}
}
}
}

subprojects {
project.evaluationDependsOn(':app')
}



tasks.register("clean", Delete) {
delete rootProject.buildDir
}

0 comments on commit e91d296

Please sign in to comment.