skip to Main Content

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

2

Answers


  1. 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

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search