Reputation: 111
I'm developing in flutter and am trying to add firebase to my flutter project.
Firebase login works, auth works, dart pub global activate flutterfire_cli works and flutterfire. I can call on firebase or flutterfire and it will list the options I have so I know the paths and installs are working.
But when I run flutterfire configure I always get this:
'''
flutterfire configure i Found 0 Firebase projects. FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command. COMMAND: firebase --version ERROR: The FlutterFire CLI currently requires the official Firebase CLI to also be installed, see https://firebase.google.com/docs/cli#install_the_firebase_cli for how to install it. '''
I've been struggling with this for a few days now and have tried firebase binary, npm, nodejs, and anything else I can find. Nothing seems to be working.
Thanks ahead of time!
Lance
Upvotes: 1
Views: 9852
Reputation: 19
Upvotes: 1
Reputation: 332
curl -sL https://firebase.tools | bash
firebase login
firebase projects:list
dart pub global activate flutterfire_cli
flutterfire configure --project=XXXXX
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,);
Upvotes: 1
Reputation: 1
dart pub global activate flutterfire_cli
export PATH="$PATH":"$HOME/.pub-cache/bin"
flutterfire configure
this works for me
Upvotes: 0
Reputation: 41
I had the same problem, I had to do the following commands in my project directory for it to work:
export PATH="$PATH":"$HOME/.pub-cache/bin"
dart pub global activate flutterfire_cli
flutterfire configure --project=project_name-genereted_firebaseapp_number
Upvotes: 3
Reputation: 1178
I had the same issue some months Ago. This happens when you have ever initialise firebase on that project, be it for hosting , cloud function e.t.c.
Here is what you should do.
Firstly
Carefully delete files and folders relating to firebase-tools on that project (.firebase , firebase.json , .firebaserc ,functions(if available) and firebase_options.dart (if available));
You can then run your
dart pub global activate flutterfire_cli
flutterfire configure
then incase the you are using flutter web and you care to deploy on firebase hosting
You can now your
firebase init;
note:- firebase init;
should on be done after
flutterfire configure
Upvotes: 9