1

I'm trying to initialize firebase functions for an iPhone app.

I have two separate accounts that I have different firebase projects on.

I ran firebase init, but I get an error

Error: Unable to authorize access to project[PROJECT ID]

where the project ID is a project id for a project in the account im not using.

I used

Firebase use --add

and it worked perfectly.

I ran

Firebase list

and the project I want to init is listed there. But when I ran the init again I got the same error with the wrong project ID still.

ps. the other project ID doesn't come up in Firebase list

EDIT: I logged out of the different account and am logged into the correct account.

NickPali
  • 47
  • 1
  • 6

3 Answers3

1

You should check the alias. Aren't you just setting your project for staging? After Firebase use --add, you should do like

What alias do you want to use for this project? (e.g. staging) default

and also

What alias do you want to use for this project? (e.g. staging) dev

In other words, you have to switch all the alias to the project you re trying to use.

This worked for me!

0

Firebase login to the account that has the project.

James Poag
  • 2,320
  • 1
  • 13
  • 20
0

If you're switching between two Google accounts, you have to firebase logout from one and firebase login to the other before you can access the projects in those different accounts.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441