invertase / flutterfire_cli

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

fix: macOS bundleId was incorrectly selecting `some.app.RunnerTests` #222

Closed russellwheatley closed 11 months ago

russellwheatley commented 11 months ago

Description

Moved the file checks for bundleId so that AppInfo.xcconfig file is checked first. This file is present on macOS, not iOS. macOS project.pbxproj file contains incorrect bundle ID. It looks like the following for each build variation for Flutter apps created with the latest Flutter SDK:

PRODUCT_BUNDLE_IDENTIFIER = com.example.cliFlutterLatest.RunnerTests;

Logs from running flutterfire configure with this latest change:

➜  cli_flutter_latest git:(main) ✗ flutterfire configure --project=some-proj --yes
Building package executable... (1.7s)
Built flutterfire_cli_monorepo:flutterfire_dev.
i Found 20 Firebase projects. Selecting project some-proj.                                                                                                                                
i Selected platforms: android,ios,macos,web
i Firebase android app com.example.cli_flutter_latest registered.                                                                                                                           
i Firebase ios app com.example.cliFlutterLatest registered.                                                                                                                                 
i Firebase macos app com.example.cliFlutterLatest registered.                                                                                                                               
i Firebase web app cli_flutter_latest (web) registered.                                                                                                                                     

Firebase configuration file lib/firebase_options.dart generated successfully with the following Firebase apps:

Platform  Firebase App Id
web       1:361461320736:web:cd8dc12dc65cfa1c6f8045
android   1:361461320736:android:b128c52ad7fbb8656f8045
ios       1:361461320736:ios:889fe0536426efaf6f8045
macos     1:361461320736:ios:889fe0536426efaf6f8045

Learn more about using this file and next steps from the documentation:
 > https://firebase.google.com/docs/flutter/setup

fixes https://github.com/invertase/flutterfire_cli/issues/182

Type of Change

almogtovim commented 10 months ago

so how can I fix it? I deleted the issued (RunnerTests) app ios app from firebase console. Now I'm getting the following macod registration error when running fluterfire configure:

FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase apps:create ios my-app (macos) --bundle-id=com.myapp.RunnerTests --json --project=my-project
ERROR: Failed to create iOS app for project my-project. See firebase-debug.log for more info