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]: CLI crashes replacing old project files #173

Closed craiglabenz closed 1 year ago

craiglabenz commented 1 year ago

Is there an existing issue for this?

CLI Version

0.2.7

Firebase Tools version

11.1.0

Flutter Doctor Output

Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, 3.9.0-0.2.pre, on macOS 12.6 21G115 darwin-arm64, locale en-US) [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use flutter config --android-sdk to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) [✓] Chrome - develop for the web [!] Android Studio (not installed) [✓] VS Code (version 1.77.0) [✓] Connected device (2 available) [✓] Network resources

! Doctor found issues in 2 categories.

Description

I deleted an old Firebase project and am regenerating from scratch. My project name is unchanged, but all the long random IDs are of course new. The CLI registered my 3 Firebase apps (iOS, Android, and macOS) successfully, then crashed when placing the google-services.json files.

Steps to reproduce

$ flutterfire configure --project= i Found 1 Firebase projects. Selecting project . ? Which platforms should your configuration support (use arrow keys & space to s ✔ Which platforms should your configuration support (use arrow keys & space to select)? · android, ios, macos i Firebase android app is not registered on Firebase project . i Registered a new Firebase android app on Firebase project . i Firebase ios app registered. i Firebase macos app is not registered on Firebase project . i Registered a new Firebase macos app on Firebase project . ? Generated FirebaseAppID file ~/Dev/washday/washday-app/macos/firebase_app_id_file.json already exists, do you want to override it? (y/n) › ye ? Generated FirebaseAppID file ~/washday/washday-app/macos/firebase_app_id_file.json already exists, do you want to override it? (y/n) › ye ✔ Generated FirebaseAppID file ~/Dev/washday/washday-app/macos/firebase_app_id_file.json already exists, do you want to override it? · yes ? The google-services.json file already exists but for a different Firebase project (). Do you want to replace it with Firebase project ? The google-services.json file already exists but for a different Firebase project (). Do you want to replace it with Firebase project ✔ The google-services.json file already exists but for a different Firebase project (). Do you want to replace it with Firebase project ? · yes Unhandled exception: Exception: /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- xcodeproj (LoadError) from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:inrequire' from -e:1:in `

'

0 ConfigCommand.run (package:flutterfire_cli/src/commands/config.dart:540:11)

#1 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #2 main (file:///Users//.pub-cache/hosted/pub.dev/flutterfire_cli-0.2.7/bin/flutterfire.dart:57:5) ### Expected behavior The CLI should have successfully replaced the old config files and completed running normally. ### Screenshots _No response_ ### Additional context and comments _No response_
craiglabenz commented 1 year ago

Got around this by deleting (my somehow empty?) and re-downloading google-services.json file and then running sudo gem install xcodeproj as indicated in #30.