From fca13756aacbe95c46be9f71168325084817836f Mon Sep 17 00:00:00 2001 From: LiJianying Date: Sun, 16 Jun 2024 09:09:45 +0800 Subject: [PATCH] fix: Fixed android builder not supporting flavor as upper case. #134 (#197) --- examples/multiple_flavors/android/app/build.gradle | 6 +++++- examples/multiple_flavors/distribute_options.yaml | 7 +++++++ .../lib/src/builders/android/build_android_result.dart | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/examples/multiple_flavors/android/app/build.gradle b/examples/multiple_flavors/android/app/build.gradle index 6f7b1171..a5736673 100644 --- a/examples/multiple_flavors/android/app/build.gradle +++ b/examples/multiple_flavors/android/app/build.gradle @@ -40,7 +40,7 @@ android { applicationId "org.leanflutter.examples.multiple_flavors" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion 19 + minSdkVersion flutter.minSdkVersion targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -61,6 +61,9 @@ android { abiFilters "arm64-v8a" } } + googlePlay { + dimension "mode" + } } buildTypes { @@ -68,6 +71,7 @@ android { productFlavors.dev.signingConfig signingConfigs.debug productFlavors.prod.signingConfig signingConfigs.debug productFlavors.prod_64.signingConfig signingConfigs.debug + productFlavors.googlePlay.signingConfig signingConfigs.debug } } } diff --git a/examples/multiple_flavors/distribute_options.yaml b/examples/multiple_flavors/distribute_options.yaml index 865fbbb3..6a6501c9 100644 --- a/examples/multiple_flavors/distribute_options.yaml +++ b/examples/multiple_flavors/distribute_options.yaml @@ -63,6 +63,13 @@ releases: target-platform: android-arm64 dart-define: APP_ENV: prod + - name: googleplay-apk + package: + platform: android + target: apk + build_args: + profile: true + flavor: googlePlay - name: release-ios jobs: - name: release-ios-dev-ipa diff --git a/packages/flutter_app_builder/lib/src/builders/android/build_android_result.dart b/packages/flutter_app_builder/lib/src/builders/android/build_android_result.dart index 9df37879..b6d070d5 100644 --- a/packages/flutter_app_builder/lib/src/builders/android/build_android_result.dart +++ b/packages/flutter_app_builder/lib/src/builders/android/build_android_result.dart @@ -91,7 +91,7 @@ class _BuildAndroidApkResultResolver extends BuildResultResolver { final r = _BuildAndroidApkResult(config)..duration = duration; final String pattern = [ '${r.outputDirectory.path}/**', - config.flavor != null ? '-${config.flavor}' : '', + config.flavor != null ? '-${config.flavor!.toLowerCase()}' : '', '-${config.mode.name}.apk', ].join(); r.outputFiles = Glob(pattern).listSync().map((e) => File(e.path)).toList();