I have searched around and have not found a solution to the exact problem I am having. I am new to coding and building apps, so hopefully this explains the issue well. 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? Any help is appreciated!
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
CodePudding user response:
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
CodePudding user response:
Lets go through some steps and see if we can solve it:
First of, have you added firebase.jason to your project ?
Have you verified that the package name of the firebase.jason file matches your project pakage 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