mirror of
https://github.com/wger-project/flutter.git
synced 2026-02-18 00:17:48 +01:00
It seems some packages that have not been updated in some years are causing problems. android_metadata has been removed here, but flutter_barcode_scanner is still needed
72 lines
2.5 KiB
Groovy
72 lines
2.5 KiB
Groovy
allprojects {
|
|
repositories {
|
|
google()
|
|
mavenCentral()
|
|
}
|
|
}
|
|
|
|
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 34
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Workaround for " Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl." error
|
|
// Note that this instance seems to be caused by flutter_barcode_scanner, which hasn't been
|
|
// updated in three years, might be time to look for a different package
|
|
subprojects {
|
|
afterEvaluate { project ->
|
|
if (project.hasProperty('android')) {
|
|
project.android {
|
|
if (namespace == null) {
|
|
project.logger.error(
|
|
"Warning: project "
|
|
+ project.name
|
|
+ " has no namespace set, this will prevent compilation, "
|
|
+ " setting one now to "
|
|
+ project.group
|
|
+ "\nIf there is not a new version of " + project.name + ", consider filing an issue against "
|
|
+ project.name
|
|
)
|
|
|
|
namespace project.group
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
project.evaluationDependsOn(':app')
|
|
}
|
|
|
|
|
|
tasks.register("clean", Delete) {
|
|
delete rootProject.buildDir
|
|
}
|