6

I forgot to logout from Firebase account in Terminal and change account before proceeding with firebase init, and I created a Firebase function for the new project with an old account, I went back and deleted the files including xcworkspace, and I run pod install and created a new workspace, and when I want to run firebase init again it says

MooMyeongs-MacBook-Pro:Doshirak moomyeong$ firebase init

     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  /Users/moomyeong/Desktop/Desktop/Applications/Doshirak

? Which Firebase CLI features do you want to set up for this folder? Press Space
 to select features, then Enter to confirm your choices. Firestore: Deploy rules
 and create indexes for Firestore, Functions: Configure and deploy Cloud Functio
ns

=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add, 
but for now we'll just set up a default project.

i  .firebaserc already has a default project, using newproject-7432a.

Error: Failed to get Firebase project newproject-7432a. Please make sure the project exists and your account has permission to access it.

Hence newproject-7432a is my old project with an old Firebase account, my new project is Doshirak

Is there anyway for me to solve this issue, or do I have to start from the beginning?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
HanKBeatz
  • 152
  • 1
  • 1
  • 10

9 Answers9

16

This message is telling you that the project directory where you're running firebase init has already been configured:

i  .firebaserc already has a default project, using newproject-7432a.

The file .firebaserc contains the ID of that project. If you don't want to use that project any more, just delete .firebaserc and run firebase init again.

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

This condition arises when we are initialising the project which has been already deployed on Firebase. While initialising the project in Firebase .firebaserc file is created which has the name of the Firebase Project where our application be deployed.

We can simply change the default the project name to the relative FirebaseBase Project name and redeploy after ngbuild.

so change go to .firebaserc file and change

  "projects": { "default": "your-previous-app" }

to

  "projects": { "default": "new-firebase-app" }
1

Change your project directory from one drive to another drive. If project directory is in C drive then switch it to D drive and then initialize and deploy again on firebase. This problem will be resolved. It is the easiest method. If you are a beginner then it is the best solution for you otherwise locating .firebaserc file will be very difficult for you.

0

Delete the .firebaserc and firebase.json from the project and re-run firebase init. Perform the proceeding steps and select Y when prompted ? File build/web/index.html already exists. Overwrite?

Firebase will initialize again for the new project Doshirak(in your case).

eqrakhattak
  • 535
  • 2
  • 7
  • 21
0

i solved this issue by changing the root directory from c: to d: drive... because i was unable to locate firebaserc file. therefore i created my project in d: drive then in cmd i pointed my project like so D:\sampleApp>

Benja
  • 91
  • 3
0

I could not actually find the .firebaserc file it was probably hidden. The easiest thing to do was delete the root folder and create a new one. Solved it for me

0
  1. delete the .firebaserc file, located in your project main folder
  2. change both package.json and package-lock.json name property to your new project name
  3. Rename your project folder to the new name, the one that matches your firebase new project
  4. run firebase init again

That worked for me!

0

I deleted .firebaserc file and now it works fine. On case you can't find firebaserc file, it is mostly located in C:\Users\User-Name.

NOTE: please make sure to show hidden files.

ZygD
  • 22,092
  • 39
  • 79
  • 102
-3

Make changes in firebase.json file

Navas Koya
  • 101
  • 1
  • 3