Open1

Flavor in Firebase

JboyHashimotoJboyHashimoto

なぜかprodが失敗する

https://pub.dev/packages/flutter_flavor
https://pub.dev/packages/flutter_flavorizr
Flavorで環境分けをするが、devはOKでもprodがエラー発生?
devと名前のついたFirebaseには接続できるが、prodはできない。しかし別のプロジェクト選択すると接続できる?

なぜだろうか?




yamlの設定

pubspec.yaml
name: text_sns # _prodを削除
description: "A new Flutter project."

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ^3.5.4

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.8
  flutter_flavor: ^3.1.3
  flutter_flavorizr: ^2.2.3
  firebase_core: ^3.6.0
  cloud_firestore: ^5.4.4

dev_dependencies:
  flutter_test:
    sdk: flutter

  flutter_lints: ^4.0.0

flutter:

  uses-material-design: true
# flavor settings
# flavorの設定はflutterセクションの外に配置
flavorizr:
  app:
    android:
      flavorDimensions: "flavor-type"
    ios:
      bundleId: "com.firebaseapp.textSns"  # 基本のbundleId
  flavors:
    dev:
      app:
        name: "テキストSNS Dev"
      android:
        applicationId: "com.firebaseapp.text_sns_dev"
      ios:
        bundleId: "com.firebaseapp.textSnsDev"
    prod:
      app:
        name: "テキストSNS"
      android:
        applicationId: "com.firebaseapp.text_sns_prod"
      ios:
        bundleId: "com.firebaseapp.textSnsProd"

  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/to/resolution-aware-images

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/to/asset-from-package

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/to/font-from-package