Firebase CLI not working (firebase deploy) - android

I have setup my firebase cloud functions and CLI correctly and deployed my function for the first time already and all worked fine.
Now that I closed the command prompt and ran it again, firebase does not recognize my project. When I run firebase deploy it give me this Error: "Error: Not in a Firebase app directory (could not locate firebase.json)". Does anyone know how to fix this?

Firebase automatically creates your firebase.json file at the root of your project directory when you run the firebase init command.
After logging into firebase with firebase login you will need to do: firebase init and then select the correct options when prompted. be sure to press the space bar to check the functions circle in the command line.you can refer to this link.
firebase login and firebase init will initialize the file firebase.json.
Also, run firebase deploy inside the root directory of the project folder where firebase.json lives..
You can follow the video tutorial in this document which might help you.

Related

I need GoogleService_Info.plist file from existing Firebase project

I have an android flutter app that I created using Android Studio on a Windows machine. However, now I need to move everything to a Mac iOS machine. This has been a true test of my patients.
I need to get the GoogleServices-Info.plist file for a Firebase project that already exists. I have followed the directions on Firebase but I don't see any download button.
1. Go to your. Project settings in the Firebase console.
2. In the Your apps card, select the bundle ID of the app for which you need a config file.
This Firebase project already existed so I don't know how to get the file.
Click on your existing Firebase project at https://console.firebase.google.com/
Select your iOS/Android app, then click on the cog icon to access to the setting page.
Click on the Download icon.
You can see the full manipulation here:

How to change Firebase id by creating another project

I want to rename my Firebase id.
I found out that the only way to do that is to create new project
How can I rename the Firebase Project ID?
I've created a new project and pasted the same android applicationId.
I've added the correct json file into my project.
Then Firebase suggests me to run my app in order to test the connection.
I've reinstalled my app, but I have no connection.
Does it mean that I should delete the prerious app in order to make this app work?
Maybe change the default project will sove this problem.
Run this command:
firebase use --add <YOUR_NEW_PROJECT_NAME>
Or if you want to test a project in emulators which is not exist on your firebase, just delete the default project by running:
firebase use --clear

Is there a way to handle Firebase projet and android application creation automation?

I'm working on a continuous project creation from an administrator tool. This tool is able to create a create a gitlab and jenkins project from template.
The android template use Firebase crashlytics and we all know that google-services.json file will be mandatory to use Firebase service.
After creating the project from our template using our administrator tool, jenkins build failed because of lack of google-services.json file.
So to retrieve google-services.json file, we need to create project firebase and android application. All of these actions are manual. My question is there a way to get this file using kind of Firebase APIs to create project and android application ?
Thanks
In android studio you get the option to link your Firebase Account. Double tap Shift and type Firebase You should get the assistant and then follow the instructions.

Can I create a Firebase account from code in my app

From a Windows, Android or IOS application, I would like to create a new Firebase account\project when the user installs the app.
Is that possible?
No, it's not possible
In order to create and add a project on firebase you need to upload your package name and
SHA-1(optional but still required for authenticating your client)
After that a JSON file will be generated and you have to put that file in your projects App folder and configure your Gradle files
so you can see now.
You cannot do this process on installing of app

Connect to Firebase failed with assistant in android studio

I want to connect my app to firebase and for that I am doing it by Firebase Assistant in android studio.
When I click on connect to firebase the following error is shown:
Firebase: Connect to Firebase failed. Please check your internet connection and try again. If errors persist, you can connect manually at https://console.firebase.google.com
SocketTimeoutException: Could not obtain an OAuth2 access token.: connect timed out
Note: I am properly connected with internet and my android studio is updated.
How to solve this problem?
Check ur firebase console once, It happens that the project gets created in firebase console but still it shows the error, If it is so, then go to project settings of that project and add the package name of the project in it, and then download the google-services.json file,add the json file in root project directory. Add the necessary dependencies for the feature u want to use from firebase assistant. U are all set to use firebase now!!..Hope it helps..
This is happening because you have exceeded your limits of making new projects in Firebase Console.
This is how your console window will look like when you try to make a new project from Firebase Console itself.
It says:
You've reached the project limit for your account. You can add Firebase to an existing project or request an increased limit.
Solution:
1) One solution is to add your application in a pre-built project of yours (if you haven't deleted all of your project and if you haven't exceeded your app limits)
2) The second solution is to REQUEST AN INCREASE in your project limits by clicking on the option below the error.
After requesting for an increase and giving a good reason for why you want an increase, you will get your increased projects limit soon and then you will be able to explore unmatchable features of the great Firebase again.
I realized that the Firebase Assistant from the sidebar is not using the proxy settings from Android Studio. So the Firebase Assistant might fail even if the Android Studio can reach the internet.
Didn't find the reason but connecting to a mobile hotspot solved the problem temporarily.
This is wired but my issue was solved when I made sure I was signed into the same Google account in the browser and Android studio :
Google Play Console
Google Developer Console
Firebase Console
Please use the latest library for firebase
implementation 'com.google.firebase:firebase-messaging:15.0.0'
please follow this guide if counter another issue
https://firebase.google.com/docs/android/setup

Categories

Resources