As the title says I am trying to host a Flutter app. But when I followed the guide in my Firebase console to add a Flutter app I keep getting stuck. My operating system is Windows and the Firebase guide to add a Flutter app is as follows:
Prepare your workspace:
-
Install the Firebase CLI and log in (run firebase login)
-
Install the Flutter SDK
-
Create a Flutter project (run flutter create)
I had already a Flutter app with the latest release of the Flutter SDK. Some poblems came with installing firebase. I wanted to do it with npm but that didn’t seem to work so I decided to use the standalone binary and place this one in my Flutter app folder (I also renamed the standalone binary to firebase.exe). After that it seemed to work and I was able to run Firebase and run Firebase commands in my wokspace powershell.
Install and run the FlutterFire CLI
Now it is time to install the Flutterfire CLI to make Firebase to add the Flutter App to my Firebase. Here I installed it using the following command in the powershell of my Flutter app:
dart pub global activate flutterfire_cli
This worked and didn’t give any issues or warnings. Then came the command to make my Flutter app ready to link it to Firebase:
flutterfire configure --project=PROJECT
Where PROJECT is where I type the real name of my project (so my project is not called PROJECT to make that clear). Here is where I get stuck because I get the following output in my powershell:
Fetching available Firebase projects...
Failed to parse JSON response from Firebase CLI. JSON response: #
Welcome to...
######## #### ######## ######## ######## ### ###### ########
## ## ## ## ## ## ## ## ## ## ##
###### ## ######## ###### ######## ######### ###### ######
## ## ## ## ## ## ## ## ## ## ##
## #### ## ## ######## ######## ## ## ###### ########
#
Let's make sure your Firebase CLI is ready...
>
FormatException: Unexpected character (at character 1)
#
This is the point where I am stuck and is my question does anybody know how to fix this?
Some things I have already tried:
- Change the name of the Firebase standalone binary to
firebase.exe
- Reinstalling NodeJs to versions 14.21.3 ,18.5.0, 20.12.2 and 22.0.0 (all 64x)
- Adding the path to npm to my system variables as well as personal variables
- Doing Firebase init in my project and installing it there. This did install Firebase in my project but didn’t make it compatible with Flutter because it did not add the
lib/firebase_options.dart
file which is neccesary - Double check if I followed all the steps and didn’t skip any of them
- Running Firebase in the powershell aswell in its own binary