firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.72k stars 3.97k forks source link

🐛 [FlutterFire_cli] configure -h produces Unhandled Exception #9296

Closed Wasmund1 closed 2 years ago

Wasmund1 commented 2 years ago

Bug report

When we call flutterfire configure -h we get the following output:

Unhandled exception:
Option platforms is mandatory.

Usage: flutterfire configure [arguments]
-h, --help                                              Print this usage information.
-p, --project=<aliasOrProjectId>                        The Firebase project to use for this command.
-e, --account=<email>                                   The Google account to use for authorization.
-o, --out=<filePath>                                    The output file path of the Dart file that will be generated with
                                                        your Firebase configuration options.
                                                        (defaults to "lib/firebase_options.dart")
-y, --yes                                               Skip the Y/n confirmation prompts and accept default options (such
                                                        as detected platforms).
    --platforms=<platforms> (mandatory)                 Optionally specify the platforms to generate configuration options
                                                        for as a comma separated list. For example
                                                        "android,ios,macos,web,linux,windows".
-i, --ios-bundle-id=<bundleIdentifier> (mandatory)      The bundle identifier of your iOS app, e.g. "com.example.app". If no
                                                        identifier is provided then an attempt will be made to automatically
                                                        detect it from your "ios" folder (if it exists).
-m, --macos-bundle-id=<bundleIdentifier> (mandatory)    The bundle identifier of your macOS app, e.g. "com.example.app". If
                                                        no identifier is provided then an attempt will be made to
                                                        automatically detect it from your "macos" folder (if it exists).
    --android-app-id=<applicationId>                    DEPRECATED - use "android-package-name" instead. The application id
                                                        of your Android app, e.g. "com.example.app". If no identifier is
                                                        provided then an attempt will be made to automatically detect it
                                                        from your "android" folder (if it exists)
-a, --android-package-name=<packageName>                The package name of your Android app, e.g. "com.example.app". If no
                                                        package name is provided then an attempt will be made to
                                                        automatically detect it from your "android" folder (if it exists).
-t, --token=<firebaseToken>                             The token generated by running `firebase login:ci`

Run "flutterfire help" to see global options.
#0      Command.usageException (package:args/command_runner.dart:445:7)
#1      CommandRunner.parse (package:args/command_runner.dart:137:15)
#2      CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:119:36)
#3      new Future.sync (dart:async/future.dart:301:31)
#4      CommandRunner.run (package:args/command_runner.dart:119:14)
#5      main (file:///Users/vagrant/.pub-cache/hosted/pub.dartlang.org/flutterfire_cli-0.2.4/bin/flutterfire.dart:57:48)
<asynchronous suspension>

Steps to reproduce

Steps to reproduce the behavior:

  1. Install Firebase tools with curl -sL https://firebase.tools/ | bash
  2. Update Firebase tools with curl -sL https://firebase.tools/ | upgrade=true bash
  3. Activate FlutterFire cli with dart pub global activate flutterfire_cli
  4. run flutterfire configure -h

Expected behavior

We expect the following output:

Configure Firebase for your Flutter app. This command will fetch Firebase configuration for you and generate a Dart file
with prefilled FirebaseOptions you can use.

Usage: flutterfire configure [arguments]
-h, --help                                  Print this usage information.
-p, --project=<aliasOrProjectId>            The Firebase project to use for this command.
-e, --account=<email>                       The Google account to use for authorization.
-o, --out=<filePath>                        The output file path of the Dart file that will be generated with your
                                            Firebase configuration options.
                                            (defaults to "lib/firebase_options.dart")
-y, --yes                                   Skip the Y/n confirmation prompts and accept default options (such as detected
                                            platforms).
    --platforms=<platforms>                 Optionally specify the platforms to generate configuration options for as a
                                            comma separated list. For example "android,ios,macos,web,linux,windows".
-i, --ios-bundle-id=<bundleIdentifier>      The bundle identifier of your iOS app, e.g. "com.example.app". If no
                                            identifier is provided then an attempt will be made to automatically detect it
                                            from your "ios" folder (if it exists).
-m, --macos-bundle-id=<bundleIdentifier>    The bundle identifier of your macOS app, e.g. "com.example.app". If no
                                            identifier is provided then an attempt will be made to automatically detect it
                                            from your "macos" folder (if it exists).
    --android-app-id=<applicationId>        DEPRECATED - use "android-package-name" instead. The application id of your
                                            Android app, e.g. "com.example.app". If no identifier is provided then an
                                            attempt will be made to automatically detect it from your "android" folder (if
                                            it exists)
-a, --android-package-name=<packageName>    The package name of your Android app, e.g. "com.example.app". If no package
                                            name is provided then an attempt will be made to automatically detect it from
                                            your "android" folder (if it exists).
-t, --token=<firebaseToken>                 The token generated by running `firebase login:ci`

Run "flutterfire help" to see global options.

Additional context

This is happening on the virtual machines of our ci provider.

output offlutterfire --version:

0.2.4

output of dart pub global activate flutterfire_cli :

+ ansi_styles 0.3.2+1s... 
+ args 2.3.1
+ async 2.9.0
+ characters 1.2.1
+ ci 0.1.0
+ cli_util 0.3.5
+ clock 1.1.1
+ collection 1.16.0
+ dart_console 1.1.2
+ deep_pick 0.10.0
+ ffi 2.0.1
+ file 6.1.2
+ flutterfire_cli 0.2.4
+ http 0.13.4
+ http_parser 4.0.1
+ interact 2.1.1
+ intl 0.17.0
+ json_annotation 4.6.0
+ matcher 0.12.12
+ meta 1.8.0
+ path 1.8.2
+ petitparser 5.0.0
+ platform 3.1.0
+ process 4.2.4
+ pub_semver 2.1.1
+ pub_updater 0.2.2
+ pubspec 2.3.0
+ quiver 3.1.0
+ source_span 1.9.1
+ stack_trace 1.10.0
+ string_scanner 1.1.1
+ term_glyph 1.2.1
+ tint 2.0.0
+ typed_data 1.3.1
+ uri 1.0.0
+ win32 2.7.0
+ xml 5.4.1 (6.1.0 available)
+ yaml 3.1.1
Downloading flutterfire_cli 0.2.4...
Downloading pub_updater 0.2.2...
Downloading interact 2.1.1...
Downloading deep_pick 0.10.0...
Downloading ci 0.1.0...
Downloading ansi_styles 0.3.2+1...
Downloading tint 2.0.0...
Downloading http_parser 4.0.1...
Downloading typed_data 1.3.1...
Downloading string_scanner 1.1.1...
Downloading pubspec 2.3.0...
Downloading uri 1.0.0...
Downloading yaml 3.1.1...
Downloading matcher 0.12.12...
Downloading quiver 3.1.0...
Downloading dart_console 1.1.2...
Downloading characters 1.2.1...
Downloading win32 2.7.0...
Downloading ffi 2.0.1...
Downloading source_span 1.9.1...
Downloading term_glyph 1.2.1...
Downloading json_annotation 4.6.0...
Downloading async 2.9.0...
Building package executables... (3.8s)
Built flutterfire_cli:flutterfire.
Installed executable flutterfire.
Activated flutterfire_cli 0.2.4.

output of firebase tools upgrade:

-- Checking for existing firebase-tools on PATH...
-- Your machine has firebase-tools@11.1.0, attempting upgrade...
-- Checking your machine type...
-- Downloading binary from https://firebase.tools/bin/macos/latest

######################################################################## 100.0%#=#=#                                                                         
##=#=#                                                                        
##=O#- #                                                                      
#-#O=#  #                                                                     

                                                                           0.0%
                                                                           0.2%
                                                                           0.4%
                                                                           1.2%
#                                                                          2.2%
##                                                                         3.6%
####                                                                       5.6%
#####                                                                      8.0%
#######                                                                   10.1%
#########                                                                 12.5%
##########                                                                14.0%
###########                                                               15.9%
#############                                                             18.5%
##############                                                            20.5%
###############                                                           21.9%
#################                                                         24.0%
##################                                                        26.3%
####################                                                      27.8%
#####################                                                     30.4%
#######################                                                   32.4%
########################                                                  33.8%
##########################                                                36.4%
###########################                                               37.8%
#############################                                             40.4%
##############################                                            41.8%
###############################                                           43.8%
#################################                                         45.9%
##################################                                        47.7%
####################################                                      50.1%
#####################################                                     52.3%
######################################                                    53.8%
########################################                                  55.8%
#########################################                                 57.9%
###########################################                               60.2%
############################################                              61.9%
##############################################                            64.3%
###############################################                           66.2%
################################################                          67.8%
##################################################                        70.3%
###################################################                       71.4%
####################################################                      72.3%
#####################################################                     73.9%
######################################################                    75.3%
#######################################################                   77.1%
########################################################                  78.9%
#########################################################                 80.0%
##########################################################                81.9%
###########################################################               83.0%
############################################################              84.3%
#############################################################             84.8%
#############################################################             85.5%
##############################################################            86.5%
##############################################################            87.0%
###############################################################           87.7%
###############################################################           88.7%
################################################################          89.1%
################################################################          89.7%
#################################################################         90.6%
#################################################################         91.0%
##################################################################        91.9%
##################################################################        92.5%
##################################################################        92.9%
###################################################################       93.7%
###################################################################       94.3%
####################################################################      95.1%
#####################################################################     96.0%
#####################################################################     96.7%
######################################################################    97.4%
######################################################################    98.2%
#######################################################################   98.8%
#######################################################################   99.6%
######################################################################## 100.0%
-- Setting permissions on binary...
-- Checking your PATH variable...
-- firebase-tools@11.4.0 is now installed
-- All Done!

Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` flutter doctor -v [✓] Flutter (Channel stable, 3.0.5, on macOS 12.4 21F79 darwin-x64, locale en) • Flutter version 3.0.5 at /Users/vagrant/fvm/versions/2.10.3 • Upstream repository https://github.com/flutter/flutter.git • Framework revision f1875d570e (3 weeks ago), 2022-07-13 11:24:16 -0700 • Engine revision e85ea0e79c • Dart version 2.17.6 • DevTools version 2.12.2 [!] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /usr/local/share/android-sdk • Platform android-32, build-tools 32.0.0 • ANDROID_HOME = /usr/local/share/android-sdk • ANDROID_SDK_ROOT = /usr/local/share/android-sdk • Java binary at: /Users/vagrant/.jenv/versions/11.0/bin/java • Java version OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9) ✗ 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 13.4.1) • Xcode at /Applications/Xcode-13.4.1.app/Contents/Developer • CocoaPods version 1.11.3 [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). [✓] Connected device (1 available) • macOS (desktop) • macos • darwin-x64 • macOS 12.4 21F79 darwin-x64 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 3 categories. ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 2.17.6 Flutter SDK 3.0.5 e_token_app 1.3.0 dependencies: - android_intent 2.0.2 [flutter platform meta] - bloc 7.2.1 [meta] - built_collection 5.1.1 - configurable_expansion_tile_null_safety 2.0.3 [flutter] - crypto 3.0.2 [typed_data] - cupertino_icons 1.0.5 - dartz 0.10.1 - dotted_border 2.0.0+2 [flutter path_drawing] - equatable 2.0.3 [collection meta] - expandable_page_view 1.0.17 [flutter] - firebase_core 1.20.0 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_messaging 12.0.1 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_bloc 7.3.3 [flutter bloc provider] - flutter_dotenv 5.0.2 [flutter] - flutter_html 3.0.0-alpha.5 [html csslib collection numerus flutter] - flutter_local_notifications 9.7.0 [clock flutter flutter_local_notifications_linux flutter_local_notifications_platform_interface timezone] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math] - flutter_secure_storage 5.0.2 [meta flutter flutter_secure_storage_linux flutter_secure_storage_macos flutter_secure_storage_platform_interface flutter_secure_storage_web flutter_secure_storage_windows] - get_it 7.2.0 [async collection] - hive 2.2.3 [meta crypto] - hive_flutter 1.1.0 [flutter hive path_provider path] - http 0.13.4 [async http_parser meta path] - internet_connection_checker 0.0.1+4 - intl 0.17.0 [clock path] - json_annotation 4.6.0 [meta] - launch_review 3.0.1 [flutter] - logging 1.0.2 - meta 1.7.0 - package_info 2.0.2 [flutter] - rxdart 0.27.5 - shared_preferences 2.0.15 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - uni_links 0.5.1 [flutter uni_links_platform_interface uni_links_web] - universal_html 2.0.8 [async csslib charcode collection html meta source_span typed_data universal_io] - url_launcher 6.1.5 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] - webview_flutter 3.0.4 [flutter webview_flutter_android webview_flutter_platform_interface webview_flutter_wkwebview] dev dependencies: - build_runner 2.2.0 [args async analyzer build build_config build_daemon build_resolvers build_runner_core code_builder collection crypto dart_style frontend_server_client glob graphs http_multi_server io js logging meta mime package_config path pool pub_semver pubspec_parse shelf shelf_web_socket stack_trace stream_transform timing watcher web_socket_channel yaml] - dependency_validator 3.2.2 [args build_config checked_yaml glob io json_annotation logging package_config path pub_semver pubspec_parse yaml] - flutter_launcher_icons 0.9.3 [args image path yaml] - flutter_lints 2.0.1 [lints] - hive_generator 1.1.3 [build source_gen hive analyzer source_helper] - json_serializable 6.3.1 [analyzer async build build_config collection json_annotation meta path pub_semver pubspec_parse source_gen source_helper] transitive dependencies: - _fe_analyzer_shared 40.0.0 [meta] - analyzer 4.1.0 [_fe_analyzer_shared collection convert crypto glob meta package_config path pub_semver source_span watcher yaml] - archive 3.3.0 [crypto path] - args 2.3.1 - async 2.8.2 [collection meta] - boolean_selector 2.1.0 [source_span string_scanner] - build 2.3.0 [analyzer async convert crypto glob logging meta path] - build_config 1.1.0 [checked_yaml json_annotation path pubspec_parse yaml] - build_daemon 3.1.0 [built_collection built_value http_multi_server logging path pool shelf shelf_web_socket stream_transform watcher web_socket_channel] - build_resolvers 2.0.9 [analyzer async build crypto graphs logging path package_config pool pub_semver stream_transform yaml] - build_runner_core 7.2.3 [async build build_config build_resolvers collection convert crypto glob graphs json_annotation logging meta path package_config pool timing watcher yaml] - built_value 8.3.2 [built_collection collection fixnum meta] - characters 1.2.0 - charcode 1.3.1 - checked_yaml 2.0.1 [json_annotation source_span yaml] - clock 1.1.0 - code_builder 4.1.0 [built_collection built_value collection matcher meta] - collection 1.16.0 - convert 3.0.2 [typed_data] - csslib 0.17.2 [source_span] - dart_style 2.2.3 [analyzer args path pub_semver source_span] - dbus 0.7.7 [args ffi meta xml] - fake_async 1.3.0 [clock collection] - ffi 2.0.0 - file 6.1.2 [meta path] - firebase_core_platform_interface 4.5.0 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 1.7.1 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_messaging_platform_interface 4.1.0 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.1.0 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - fixnum 1.0.1 - flutter_local_notifications_linux 0.5.0+1 [flutter flutter_local_notifications_platform_interface dbus path xdg_directories] - flutter_local_notifications_platform_interface 5.0.0 [flutter plugin_platform_interface] - flutter_secure_storage_linux 1.1.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_macos 1.1.0 [flutter flutter_secure_storage_platform_interface] - flutter_secure_storage_platform_interface 1.0.0 [flutter plugin_platform_interface] - flutter_secure_storage_web 1.0.2 [flutter flutter_web_plugins flutter_secure_storage_platform_interface js] - flutter_secure_storage_windows 1.1.2 [flutter flutter_secure_storage_platform_interface] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters charcode collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - frontend_server_client 2.1.3 [async path] - glob 2.0.2 [async collection file path string_scanner] - graphs 2.1.0 [collection] - html 0.15.0 [csslib source_span] - http_multi_server 3.2.0 [async] - http_parser 4.0.1 [collection source_span string_scanner typed_data] - image 3.2.0 [archive meta xml] - io 1.0.3 [meta path string_scanner] - js 0.6.4 - lints 2.0.0 - matcher 0.12.11 [stack_trace] - material_color_utilities 0.1.4 - mime 1.0.2 - nested 1.0.0 [flutter] - numerus 1.1.1 - package_config 2.0.2 [path] - path 1.8.1 - path_drawing 1.0.0 [vector_math meta path_parsing flutter] - path_parsing 1.0.0 [vector_math meta] - path_provider 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - path_provider_android 2.0.14 [flutter path_provider_platform_interface] - path_provider_ios 2.0.9 [flutter path_provider_platform_interface] - path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.6 [flutter path_provider_platform_interface] - path_provider_platform_interface 2.0.4 [flutter platform plugin_platform_interface] - path_provider_windows 2.1.0 [ffi flutter path path_provider_platform_interface win32] - petitparser 5.0.0 [meta] - platform 3.1.0 - plugin_platform_interface 2.1.2 [meta] - pool 1.5.0 [async stack_trace] - process 4.2.4 [file path platform] - provider 6.0.3 [collection flutter nested] - pub_semver 2.1.1 [collection meta] - pubspec_parse 1.2.0 [checked_yaml collection json_annotation pub_semver yaml] - shared_preferences_android 2.0.12 [flutter shared_preferences_platform_interface] - shared_preferences_ios 2.1.1 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_macos 2.0.4 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.0.0 [flutter] - shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - shelf 1.3.0 [async collection http_parser path stack_trace stream_channel] - shelf_web_socket 1.0.1 [shelf stream_channel web_socket_channel] - sky_engine 0.0.99 - source_gen 1.2.2 [analyzer async build dart_style glob meta path source_span yaml] - source_helper 1.3.2 [analyzer collection source_gen] - source_span 1.8.2 [collection path term_glyph] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.0 [charcode source_span] - term_glyph 1.2.0 - test_api 0.4.9 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - timezone 0.8.0 [path] - timing 1.0.0 [json_annotation] - typed_data 1.3.1 [collection] - uni_links_platform_interface 1.0.0 [flutter plugin_platform_interface] - uni_links_web 0.1.0 [flutter flutter_web_plugins uni_links_platform_interface] - universal_io 2.0.4 [collection crypto meta typed_data] - url_launcher_android 6.0.17 [flutter url_launcher_platform_interface] - url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.0 [flutter plugin_platform_interface] - url_launcher_web 2.0.11 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface] - vector_math 2.1.2 - watcher 1.0.1 [async path] - web_socket_channel 2.2.0 [async crypto stream_channel] - webview_flutter_android 2.8.14 [flutter webview_flutter_platform_interface] - webview_flutter_platform_interface 1.9.1 [flutter meta plugin_platform_interface] - webview_flutter_wkwebview 2.8.1 [flutter path webview_flutter_platform_interface] - win32 2.7.0 [ffi] - xdg_directories 0.2.0+1 [meta path process] - xml 6.1.0 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner] ```

darshankawar commented 2 years ago

@Wasmund1 flutterfire configure related issue need to be reported in dedicated repo: https://github.com/invertase/flutterfire_cli/issues

Closing from here.