build.gradle 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. allprojects {
  2. repositories {
  3. google()
  4. mavenCentral()
  5. }
  6. }
  7. rootProject.buildDir = "../build"
  8. subprojects {
  9. /**************************
  10. * https://github.com/flutter/flutter/issues/153281
  11. * 受影响插件:image_gallery_saver
  12. * **************/
  13. //==========================================================================================
  14. afterEvaluate { project ->
  15. if (project.extensions.findByName("android") != null) {
  16. Integer pluginCompileSdk = project.android.compileSdk
  17. if (pluginCompileSdk != null && pluginCompileSdk < 31) {
  18. project.logger.error(
  19. "Warning: Overriding compileSdk version in Flutter plugin: "
  20. + project.name
  21. + " from "
  22. + pluginCompileSdk
  23. + " to 31 (to work around https://issuetracker.google.com/issues/199180389)."
  24. + "\nIf there is not a new version of " + project.name + ", consider filing an issue against "
  25. + project.name
  26. + " to increase their compileSdk to the latest (otherwise try updating to the latest version)."
  27. )
  28. project.android {
  29. compileSdk flutter.compileSdkVersion
  30. }
  31. }
  32. if (project.hasProperty('android')) {
  33. project.android {
  34. if (namespace == null) {
  35. namespace project.group
  36. }
  37. }
  38. }
  39. }
  40. }
  41. //==========================================================================================
  42. project.buildDir = "${rootProject.buildDir}/${project.name}"
  43. }
  44. subprojects {
  45. project.evaluationDependsOn(":app")
  46. }
  47. tasks.register("clean", Delete) {
  48. delete rootProject.buildDir
  49. }