invertase / flutterfire_cli

A CLI to help with using FlutterFire in your Flutter applications.
Apache License 2.0
171 stars 47 forks source link

[bug]: firebase.json cannot handle flavors #158

Closed EArminjon closed 1 year ago

EArminjon commented 1 year ago

Is there an existing issue for this?

CLI Version

0.3.0-dev.16

Firebase Tools version

9.23.1

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.3.4, on macOS 13.2.1 22D68 darwin-arm, locale fr-FR) • Flutter version 3.3.4 on channel stable at /Users/enguerrandarminjon/fvm/versions/3.3.4 • Upstream repository https://github.com/flutter/flutter.git • Framework revision eb6d86ee27 (5 months ago), 2022-10-04 22:31:45 -0700 • Engine revision c08d7d5efc • Dart version 2.18.2 • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/enguerrandarminjon/Library/Android/sdk • Platform android-33, build-tools 30.0.3 • ANDROID_HOME = /Users/enguerrandarminjon/Library/Android/sdk • ANDROID_SDK_ROOT = /Users/enguerrandarminjon/Library/Android/sdk • Java binary at: /Users/enguerrandarminjon/Library/Java/JavaVirtualMachines/corretto-1.8.0_322/Contents/Home/bin/java • Java version OpenJDK Runtime Environment Corretto-8.322.06.1 (build 1.8.0_322-b06) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2022.1) • Android Studio at /Users/enguerrandarminjon/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/221.6008.13.2211.9477386/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart ✗ Unable to find bundled Java version. • Try updating or re-installing Android Studio.

[✓] Connected device (3 available) • SIMU IPHONE 14 PRO (mobile) • 23B8F2A1-1290-4948-92F1-50149FF75D26 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 13.2.1 22D68 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.177

[✓] HTTP Host Availability • All required HTTP hosts are available

! Doctor found issues in 1 category.

Description

{
  "flutter": {
    "platforms": {
      "ios": {
        "buildConfigurations": {},
        "targets": {
          "Runner": {
            "projectId": "my_project_id",
            "appId": "my_app_id",
            "uploadDebugSymbols": true,
            "serviceFileOutput": "ios/Firebase/clienta/GoogleService-Info.plist"
          }
        },
        "default": {}
      },
      "macos": {
        "buildConfigurations": {},
        "targets": {},
        "default": {}
      }
    }
  }
}

Steps to reproduce

Imagine having 2 flavors : clienta and clientb

$> flutterfire configure #followed by clienta settings
$> flutterfire configure #followed by clientb settings

Launch app as following :

$> flutter run -t lib/main_clienta --flavor clienta

As the last flutterfire configure the clientb, my clienta app will start with the wrong GoogleService-Info.plist, the firebase instance is the wrong one etc.

Expected behavior

I would see my app take the right GoogleService-Info.plist file.

Screenshots

No response

Additional context and comments

No response

EArminjon commented 1 year ago

Problem solved : Must use ios-build-config flag.