I am trying to configure my flutter project using flutterfire configure command. However, the CLI tool doesn't show my firebase project I want to configure the app with. What should I do?
CLI output
Firebase console
Related
iam new to flutterfire whenever i try to type the command "flutterfire configure" in the terminal of my project directory i get an error
the error is
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 just installed firebase Cli from the official website so it's updated
i have no node.js experience so i installed from the option standalone binary as recommanded
i already created my firebase project from the website but it dosen't read it on the terminal saying "0 Firebase projects" as i showed above
I found the answer ....
first we need to install node.js on the device we are using
second and after the installation open CMD and run the COMMAND
"npm install -g firebase-tools"
then after the installation run "flutterfire configure" COMMAND
that worked for me .
i got all of that from that video
https://www.youtube.com/watch?v=XCLmq7-zc_E&t=434s
I have a current Flutter project which is linked to a Firebase project and is reading and writing from a Realtime Database. My issue is that I have used the wrong project and now want to switch my Flutter app to use a different Project's Realtime Database. Is it possible to switch the Firebase project my app is currently linked to and if so how do I go about doing that?
Thanks
The FlutterFire CLI is a great tool for quickly configuring Firebase resources for Flutter projects and it could be used to switch the Firebase project to which the configuration files in your Flutter project are pointed.
First you could want to set up the FlutterFire CLI by following the instructions on the Firebase site:
Install the Firebase CLI.
Log into Firebase using the Google account under which you have the new Firebase project you want to switch to set up by running the following command: firebase login
Install the FlutterFire CLI by running the following command from any directory: dart pub global activate flutterfire_cli
Then, after getting the FlutterFire CLI set up, it would probably be a good idea to make sure your current Firebase configuration is backed up some how, either using version control or manually.
Finally, to switch your Flutter configuration to a different Firebase project, run flutterfire configure and follow the steps in the workflow, making sure to select the new Firebase project.
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
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
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
I am new to coding and building apps. I already have a Firebase project initialized and is connected to my Flutter project (I am using Android Studio). Everything is working fine. However, I am now starting to need to use Cloud Functions and need to use some Firebase Tools and the Firebase emulators for my app. However, when I try to start the emulator I get the following errors.
Error: Not in a Firebase app directory (could not locate firebase.json)
From reading around, it looks like firebase init can resolve this problem, but I already have the project initialized, so I am not sure how to solve this error. Or is it okay to reinitialize the project?
I have firebase, npm, and node all installed on my machine.
project % firebase --version
10.1.5
project % npm --version
6.14.15
project % node --version
v14.18.0
I am not sure but the problem I think is Error: Not in a Firebase app directory (could not locate firebase.json)
Make sure your project has firebase.json or google-services.json.
if you haven't installed firebase tools
npm install -g firebase-tools
then
firebase init
Lets go through some steps and see if we can solve it:
First of all, have you added firebase.json to your project ?
Have you verified that the package name of the firebase.json file matches your project package name? - Check if it is the same packagename as your project
Have you connected/gotten the SHA-1 key and connected it to your firebase project?
enter image description here
I have some doubts about CI-CD for Flutter Project. I tried to build flutter apk in Linux (ubuntu) using Jenkins I gotĀ anĀ error flutter not found while using flutter comments in Jenkins. I set the global environmental variables for flutter and Android SDK it's possible to do flutter CI-CD in Jenkins on Linux environment
I run the project locally and build the application it's working fine
But I tried the same comments via Jenkins it's showing flutter not found
Does anyone knows this problem
enter image description here
enter image description here