flutterfire_cli icon indicating copy to clipboard operation
flutterfire_cli copied to clipboard

[bug]: firebase.json and .firebaserc files are missing after flutterfire configure and needed by the firebase emulator

Open graemep-nz opened this issue 3 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

CLI Version

0.2.4

Firebase Tools version

11.3.0

Flutter Doctor Output

C:\Users\graem>flutter doctor -v [√] Flutter (Channel stable, 3.0.3, on Microsoft Windows [Version 10.0.22000.795], locale en-NZ) • Flutter version 3.0.3 at C:\Tools\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 676cefaaff (4 weeks ago), 2022-06-22 11:34:49 -0700 • Engine revision ffe7b86a1e • Dart version 2.17.5 • DevTools version 2.12.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at C:\Users\graem\AppData\Local\Android\sdk • Platform android-32, build-tools 30.0.3 • Java binary at: C:\Tools\Android\AndroidStudio\jre\bin\java • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840) • All Android licenses accepted.

[√] Chrome - develop for the web • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.2.3) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community • Visual Studio Community 2022 version 17.2.32526.322 • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2) • Android Studio at C:\Tools\Android\AndroidStudio • 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 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.53.2) • VS Code at C:\Users\graem\AppData\Local\Programs\Microsoft VS Code • Flutter extension can be installed from: https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (5 available) • S119 (mobile) • 0123456789ABCDEF • android-arm64 • Android 9.0 (API 24) • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22000.795] • Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.134 • Edge (web) • edge • web-javascript • Microsoft Edge 103.0.1264.62

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

• No issues found!

Description

https://firebase.google.com/docs/emulator-suite/install_and_configure The above web page below says this <> If you haven't already done so, initialize the current working directory as a Firebase project, following the onscreen prompts to specify which products to use:

firebase init </>

This needs updating for flutter users who have used "flutterfire configure" (instead of firebase init) to create their project.

According to this archived page there is some conflict between the "flutterfire configure" method and the "firebase init" method so the solution for flutterfire users is probably not as simple as just calling firebase init. https://firebase.flutter.dev/docs/migration

The "flutterfire configure" method results in two missing files that you need to have for the emulator - firebase.json and .firebaserc. firebase.json needs to be updated when the services being used are changed.

Steps to reproduce

  1. Start the firebase emulator from within your firebase directory
  2. The emulator reports firebase.json and .firebaserc files are missing and doesn't run

Expected behavior

The emulator should run without errors instead of not running

Screenshots

No response

Additional context and comments

No response

graemep-nz avatar Jul 22 '22 08:07 graemep-nz