invertase / flutterfire_cli

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

[bug]: flutterfire configure - failing to detect ios target #178

Closed oander11 closed 8 months ago

oander11 commented 1 year ago

Is there an existing issue for this?

CLI Version

0.2.7

Firebase Tools version

11.25.2

Flutter Doctor Output

[✓] Flutter (Channel stable, 3.7.10, on macOS 13.3 22E252 darwin-arm64 (Rosetta), locale en-SE) • Flutter version 3.7.10 on channel stable at /Users/olaepspot/Flutter/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 4b12645012 (5 weeks ago), 2023-04-03 17:46:48 -0700 • Engine revision ec975089ac • Dart version 2.19.6 • DevTools version 2.20.1

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/olaepspot/Library/Android/sdk • Platform android-31, build-tools 30.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

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

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

[✓] Android Studio (version 2022.2) • Android Studio at /Applications/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 • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.64.0

[✓] Connected device (2 available) • macOS (desktop) • macos • darwin-arm64 • macOS 13.3 22E252 darwin-arm64 (Rosetta) • Chrome (web) • chrome • web-javascript • Google Chrome 113.0.5672.92

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

Description

I have a Flutter ios app with two targets, the standard Runner target and an additional ImageNotification target which I need for Firebase messaging.

When I run flutterfire configure it just configures an app in Firebase for the ImageNotification, with Bundle Id: com.mydom.myapp.ImageNotification, not the needed main, runner one (with Bundle Id com.mydom.myapp).

The issue appeared when i installed the Firebase Auth plugin, as described below in the steps to reproduce.

Steps to reproduce

  1. Create a flutter app with support for Firebase messaging, add ImageNotification support for ios and verify that notifications with images works on ios target devices.
  2. Add support for Firebase Auth, in Flutter app and enable email auth on your Firebase project
  3. Run flutterfire configure again to enable the authorization
  4. Run code with password signin and find out that Firebase auth does not connect to your Firebase project
  5. Delete any ios app you have in Firebase and rerun flutterfire configure
  6. Verify that you don't get the expected app created in your Firebase project

Expected behavior

flutterfire configureshould recreate the expected Firebase app

Screenshots

No response

Additional context and comments

My (failing) attempts to find a solution via SO contains a bit more (probably irrelevant) details, like code snippets and such: https://stackoverflow.com/questions/76215623/how-to-get-missing-app-into-firebase-options https://stackoverflow.com/questions/76206648/how-do-i-setup-firebase-password-authentication-for-flutter

russellwheatley commented 8 months ago

Use the latest FlutterFire version:

dart pub global activate flutterfire_cli 0.3.0-dev.18 --overwrite

You can select the target you wish to configure using this flag --ios-target=<iosTargetName>.