I have two separate firebase consoles accessed from two separate google accounts.
Originally, I set up the Firebase "A" console using flutterfire cli flutterfire configure and it worked just fine, but setting up "B", it seems like there is some kind of caching for "A" issue.
In my completely separate google account for firebase console "B" I have created a project that I now need to run flutterfire configure for in the separate directory for project "B".
Using firebase login:add [email protected] and firebase login:add [email protected]. Both accounts have been authed, no problem. So I should be able to use firebase login:use to switch between the two, however flutterfire configure and firebase projects:list do not seem to respect which firebase account I'm signed into. They only show the projects for "A", never "B".
For example, switching to the directory for firebase project "B", I run firebase login:use [email protected] and then flutterfire configure [email protected]. flutterfire configure, incorrectly, the 3 projects from "A". Running firebase projects:list in directory "B" after running firebase login:use [email protected], only shows the projects from "A", not the 1 project I'm expecting to see from project "B".
In the directory for project "B", I tried running firebase init and it correctly listed my 1 project for "B" and I was able to init. But immediately after the init, running flutterfire configure or flutterfire configure [email protected], in the directory for "B", the following exception is returned, stating it can't find project "B" in the firebase account for "A". Notice that it states it "Found 3 Firebase projects", but project "B" only has 1 project, "A" has 3 projects.
i Found 3 Firebase projects. Selecting project B.
FirebaseProjectNotFoundException: Firebase project id "B" could not be found on this Firebase account.
And I am signed into to "B", not "A". Some kind of cache issue? How do I break the cache?
I have completely removed npm -g firebase-tools and flutterfire from dart global. I've deleted all .firebaserc and firebase.json files I could find. None of it worked.
If you're having issues switching accounts firebase projects:list --debug may very well give you the insight for more difficult issues like mine here.
Using firebase projects:list --debug I saw that the authorization was using an ENV FIREBASE_TOKEN, which at some point I must have put into my ~/.bashrc. This token was for project "A". I removed the ENV token and now everything is working as expected.
I had the same scenario. What worked for me was the following:
Add the A account in the possible accounts to use.
firebase login:add [email protected]
Configure project selection with correct account.
flutterfire configure --account [email protected]
Step 1: See all available accounts
firebase login:list
Step 2: Add more accounts:
firebase login:add [email protected]
Step 3: Switch to another email
firebase login:list (to see if email was successfully added)
firebase login:use [email protected] (to switch email)
Step 4 :
flutterfire configure --account [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With