Connect to Firebase failed with assistant in android studio - android

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

Related

Firebase console sdk setup showing as unfinished

I created an android application on Android studio 3.4.2 and integrated Firebase using the firebase assistant tool provided on Android studio.There is no problem with using the features of Firebase on the app but when going to the developer's console of Firebase and going to the project overview, it appears as if the the sdk setup is not finished ,I tried following the sdk setup steps provided and the setup won't finish at the last stage i.e, "checking if the app has communicated with our servers,you may need to uninstall and reinstall the app". I've uninstalled my app and reinstalled it but doesn't seem to be registering the app on the Firebase server.
I've tried restarting the internet, Uninstalled my app and reinstalled,made sure net connectivity are okay on both emulator and pc
Check your Firebase console projects, Is there any project with the same package name?. If there is any please remove and try again.

SDK setup for Flutter app won´t finish in Firebase

I made a Flutter app which i try to connect to Firebase (via console) to use a database.
The app registration has been done and the google services file as well as the Firebase SDK are added to the Android section in my project.
The connection gets checked on step 4 but it won´t proceed.
My guess is that the Firebase SDK might not be synced yet. I didn´t find any "Sync now" button for my Gradle files in the Flutter project. I also added the Google Services.json file anew several times but it didn´t change anything.
Looking forward for your tips and answers.
Greetings.

Android app no longer linking to existing firebase project

Using android studio, I created an app and linked it to a Firebase project.
I opened the app on my android studio recently and discovered it wasn't linked to my Firebase project any longer. I checked the Firebase console and saw that the app was still connected. However, it's still not reflecting in my android studio.
When I try to connect my app to Firebase (afresh), I can clearly see my Firebase project as one of the options (with one app connected ==> my app).
In summary, how do I reconnect an app to firebase?
I have tried restarting my android studio, cleaning the project, invalidating cache and restarting.
As long as there is no external tampering with an android studio project, an android app would always remain connected to Firebase.
I was able to solve this problem by signing out of all my Google accounts and then signing in with the account associated with the project. All I had to do after was attempt to reconnect again and kAbOoM, it worked fine.
There are two extra checkers/fixes I'd recommend to anyone that runs into this problem:
Check whether the google-services.json file exists. It's usually in the /app directory of android projects. If this file does not exist, it means the app is not connected to any Firebase project. One can then proceed to connect one's app to Firebase either manually or on the android-studio IDE. If the file exists, proceed to 2.
Dependencies: A lot of Firebase-type problems stem from dependency issues. Ensure the following:
Avoid version conflicts Ensure that all dependencies are up-to-date Take warnings seriously, they are like seedling-errors
I hope this helps other people who might run into this error.. Merry coding!

No clients were able to be added to your Firebase project

I recently released an Android App on the playstore this app is currently linked with both Google's Admob and Google's firebase for analytics, after a while I started working on an update that includes FIREBASE NOTIFICATIONS when I tried to connect firebase to the project I got this error:
Firebase
No clients were able to be added to your Firebase project for the following reasons:
An app with this package name and SHA1 is already connected to a Google project. If you have used a Google API previously, please select that project in the Connect to an existing project list.
Client Package Name: xxxxxxxxxxxxxxxxxxxxxxxxx
Client SHA1: [xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx]
How to fix this without loosing my previous analytics stats ?
You Should Use The existing App And Include Feature For Push Notifications at Firebase console or firebase assistant in studio
As you are creating a new project in firebase assistant for push notifications but you have aldready added this app for another services it Wont use two firebase projects for Single application so Make Sure You Are Going With The Past Project which you have done for admob and then go to cloud messaging amd enable it then you will successfully connect
If any errors again i can Help
Thank you
And If You Created Aldready you can import that project into previous project but make sure that you use same firebase account
https://firebase.google.com/support/faq/
Use this link to know about importing projects

Is there another place to get a google-services.json?

I tried clicking the GET A CONFIGURATION FILE link from the docs, but the resulting page just loads and loads. This happens in Firefox and Chrome and on my phone. Is there some other way to get a config file?
EDIT: I am getting these errors in Chrome Dev Console:
Refused to display 'https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…ed%253Dtrue%26cntlbl%3DContinue%2BAdding%2BSign-In%26cntapi%3Dsignin&hl=en' in a frame because it set 'X-Frame-Options' to 'DENY'.
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://console.developers.google.com') does not match the recipient window's origin ('null').(anonymous function) # script_foot.js:348n.event.dispatch # jquery.min.js:3r.handle # jquery.min.js:3
This might be a temporary issue due to network connectivity or something like that.
One solution would be to try again at a later point in time. This might be happening because you're trying to download the google-services.json for the sample project (com.google.samples.quickstart.signin).
If you want result now, you could follow the steps to integrate the Google Sign In into your app.
Create a new empty android studio project/if you have an existing
project skip this step.
Use this link and follow the onscreen instructions to generate the google-services.json for your app.
The app name here refers to your project name in Google Developers
Console. If you've already setup your Google developers console
project for your android app, you can select that via the drop-down
menu. If you have not created one, just enter a name and that
project will be created for you in your developers console.
Select the google services you need for your project viz Google Sign
In, Google Cloud Messaging, AdMob etc. In our case, we just selected
Google Sign In.
You will be asked for SHA-1 hash. Follow these steps to get one.
Click on generate configuration files. Next screen you will be presented with an option to download google-services.json for your app. Download that and you're good to go.
Once you have the google-services.json, follow these steps to complete the Google Sign In.
References
Start Integrating Google Sign-In into Your Android App,
Integrating Google Sign-In into Your Android App.
You will get "google-services.json" as soon as you create a Firebase project.
But, in case you missed and forgot to download that, you can still get the JSON file from the existing project-
Just select the project from firebase console.
Head over to project settings
scroll down (Yeah!, there it is!)
Screenshot :
OK, I've found a workaround if anyone else is having this problem.
Based on the error message about being unable to display https://accounts.google.com/ServiceLogin?service=cloudconsole&osid=1&passiv…ed%253Dtrue%26cntlbl%3DContinue%2BAdding%2BSign-In%26cntapi%3Dsignin&hl=en in a frame... I just followed that link directly.
EDIT: None of the other links were working for me. If you came searching for the console errors Refused to display..., this is the answer for you. This bug seems to have been fixed for the google-services.json, so if you're just looking for the link, the highest-rated answer is the one you want.
Referring to this page:
The Firebase console will help you download the google-services.json. In addition, the Quickstart guides for most APIs have instructions for generating this file. Once you have downloaded the google-services.json file, copy it into the app/ folder of your Android Studio project, or into the app/src/{build_type} folder if you are using multiple build types.
So go to Firebase Console, press add new project and follow instructions

Categories

Resources