I'm trying to enable the Google Sign-In provider in Firebase Authentication, but it's failing to be enabled when I click Save as I'm getting a "Error updating Google" message.
I have added my SHA1 fingerprint to my Firebase project and I tried enabling the provider in incognito mode, but it still fails. I also checked the Menu -> More tools -> Developer tools for errors, but I don't see any. How do I fix this?
The solution is to recreate the Firebase and Google Cloud projects.
After deleting everything, first create a Firebase project. Then, the Google Cloud project will be created automatically. There is no need to create a separate Google Cloud project.
After this, don't forget to delete and create new SHA-1 and web_client_id keys:
delete the debug.keystore.
run ./gradlew signingreport from the app's directory to make sure there are no keys remaining.
build the app in Android Studio - it will generate new keys automatically during new build.
run ./gradlew signingreport from the app's directory to make sure that new keys are there.
You may also refer to this documentation.
I tried installing the Export Collections to BigQuery extension to send firestore collection data to BigQuery. The installation succeeded but could never get the queries to work. I kept getting the error:
Not found: Dataset myproject:firestore_events was not found in location US
I tried uninstalling and reinstalling. I now have two instances of the extension and attempts to uninstall fail with ther error:
failed to remove IAM roles from Service Account for projects/myproject/instances/firestore-bigquery-export
Is there a way to uninstall manually?
Is there a way to install manually?
The following error message means that your FROM statement may not contain the proper query structure - project, database, and table:
Not found: Dataset myproject:firestore_events was not found in location US
For example:
SELECT *
FROM `my-project.my-database.my-table`
Please note the backticks.
Refer to Error: Not found: Dataset my-project-name:domain_public was not found in location US for details about a similar issue.
Now, in regards to the second error message:
failed to remove IAM roles from Service Account for projects/myproject/instances/firestore-bigquery-export
I suspect that after reinstalling and uninstalling one of the extension instances, its service account might already be deleted and thus failing to remove its IAM roles.
The installation of this extension generates a new service account that has the BigQuery Data Editor role to access your project and resources. This role allows the extension to configure and export data into BigQuery.
From documentation:
When you uninstall an extension from your project, Firebase deletes the service account created for that instance of the extension. After this deletion of the service account, the extension cannot run in your project because it no longer has any access rights to your project or data.
I was able to uninstall and reinstall the Export Collections to BigQuery extension to avoid duplicates in my project without any issues.
To answer your last question, I am not aware of any other methods to install/uninstall Firebase extensions other than what is shown in the documentation. You can install the extension using the Firebase Console or the Firebase CLI:
1 - Install the Firebase CLI or update it to the latest version:
npm install -g firebase-tools
2 - Install the extension:
firebase ext:install firestore-bigquery-export --project=projectId_or_alias
Edited
We can take the following steps to troubleshoot error:
failed to remove IAM roles from Service Account for projects
Please make sure that you're the owner of the project that you are installing extensions in.
Refer to this GitHub issue to uninstall the extension using the CLI.
If that didn't help, try disabling and re-enabling the Firebase Extensions API inside the GCP Console.
Please make sure that Firebase Management API is enabled in your project.
If that didn't help, navigate to the IAM Permissions page on the Cloud Console, and find the service account.
Add the Cloud Functions Developer and Firebase Extensions API Service Agent roles.
If those roles not available for some reason, just adding the Project Editor role also works as a catch-all. However, using the catch-all also provides additional permissions to the service accounts.
I had a similar issue when installing a Firebase Extension.
My error was adding an IAM role that did not exist, this not only failed to install the extension, but also then stopped me from uninstalling with the error failed to remove IAM roles from Service Account for.
To fix this issue I edited what I knew was the broken permission to be the correct role and then ran the following...
firebase ext:update ${ext-name} . --project={project-name}.
Alternativley, removing all roles completetly from the configuration and updating will have the same result.
One completed, the uninstallation process will automatically continue and uninstall your extension.
After adding a second project to my code using the command $ firebase use --add second-project, I get the error
There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.
Error: HTTP Error: 404, Could not find Application "second-project".
when I run $ firebase deploy.
I have added separate targets and a web app through Firebase console for the second project.
What should I be checking to get rid of this error?
I just ran into this same exact issue as well. Leaving this here for anyone that runs into this issue in the future. What caused this error for me was a permissions error, when Firebase tried to access specific resources in Google Cloud such as Cloud Functions without the necessary IAM/service accounts in place.
This happens when you create a new Firebase project without setting the Default GCP resource location under Settings > General in the Firebase Console, which occurs when you create a new Firebase project without doing any additional setup. You can set this in the settings or this is also set when you follow the walk-through instructions for setting up services such as Firestore or Firebase Storage in the Firebase console.
Without this set, the <YOUR_FIREBASE_PROJECT_NAME>#appspot.gserviceaccount.com IAM/service account will not be created in Google Cloud (which is needed to create/access specific resources), therefore when you run firebase deploy, it will fail with the error you mentioned above.
You can also check why your firebase deploy is failing in the firebase-debug.log that is generated when running this command (that's how I found out the cause of this error). Though I think this file is deleted after the command finishes execution, so you'll have to pipe the output into a file or save it some other way.
TL;DR: Set Default GCP resource location, one way this can be done is in the Firebase Console under Settings > General.
i am developing a serverless client app that uses Firebase authentication and other services from Google. It was all working nicely, when suddely the FB login authentication stopped working. It happens that when try to login the user i obtain a 400 BADREQUEST with the following body:
{
"error": {
"code": 400,
"message": "API key expired. Please renew the API key.",
"errors": [{
"message": "API key expired. Please renew the API key.",
"domain": "global",
"reason": "badRequest"
}],
"status": "INVALID_ARGUMENT"
}
}
The url causing the problem is:
https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=AIzaSyDXJ1Lwo_Md0xZzFfPX9Y8dQWOaODE4uiM&cb=1534851951010
Some weird things:
i tested with totally different projects (so brand new keys): still failing
if i go to cloud console i found several unrestricted keys automatically created by Google (i attach a screenshot)
I also created a brand new app and executed it locally. Same outcome.
Any ideas ?
Add: i have just discovered that the Identity API is effectively returning me 100% failures at the moment.
I was able to get this issue as well and this helped me solve my issue:
Go to google api console and find the key: Android key (auto created by Google Service). These keys are automatically generated by Firebase when you choose the option: Email/password in authentication. Copy that key.
Go to the google-services.json in your android studio under the projects section. Click on the file and look for the api_key -> current_key. Modify that value with the api key in step 1.
I had the same problem, i fixed it by:
Resetting my project, which included...
Deleting the Google-Services.json file, replacing the SHA1 key, syncing and adding the new Google-Services.json file on my project. hope it helps you.
Cheers
I Was able to resolve the issue by going into my firebase project settings> General> update my old API key with the Web API key value.
First, go to https://console.firebase.google.com/
Then choose the Android project
Then go to SETTINGS of that project
First, check that: sha1 and sha256 fingerprint are there for debug apk (Necessary) and release apk (necessary if you create a signed apk)
There you will see a download JSON file button, click on it, and download the file.
Then go to Android Studio and OPEN your project.
Then on the left side menu, click the project subfile then find the googleservices.json file.
Open that file by double-clicking it
Now open the downloaded file, googleservices.json, and open it in notepad.
Now copy all the content, just select all, and copy.
Now go to the Android Studio, and right-click on the Google services file (in IntelliJ) and click compare with the clipboard and carefully accept all the differences into the Android Studio file.
Or you can directly remove all the content and paste the copied into the Android Studio JSON file.
DONE!
NOTE: Make sure you make a copy of the file before doing this.
Open the Firebase Console.
Go to the Project Settings -> General Tab -> Your Web API Key Would have been Updated Automatically. Then Copy that API Key and replace it with API key in your environment.ts File and it will be Working.
Hope it Helps You!
In my case, Android Studio hasn't correctly generated string.xml based on the updated data in google-services.json, so when I replaced the old API key manually, it finally worked.
AngularFire, Ionic, Angular
I got the new API key from Browser key (auto-created by Firebase) in Google cloud console and replace it:
environment.prod.ts
firebaseConfig: {
apiKey: 'here'
}
and also D:\me\my-mobile\android\app\google-services.json
"api_key": [
{
"current_key": "here"
}
Now it is working fine.
Go to your google cloud platform, Goto API credentials and compare your downloaded google services JSON from Firebase with what's in the API credentials of GCP.
It can so happen that youre using a wrong ClientID or API key in your JSON.
Cheers
I was able to clear this issue by the following steps:
This is happening because of the expired Web- API key in firebase. So open your project console.
Move to your project settings
Grab the Web-API key over there
Open your flutter project and move to google-services.json file
replace the current-key value with the new copied API key.
Or simply replace old google-services.json file with newly downloaded one which is present in the same project settings.
Run flutter clean in your project terminal
Run flutter pub-get to get dependencies
Rebuild your app and done.
Hi All if you are getting this error:
error: Error [firebase_auth/internal-error] {"error":{"code":400,"message":"API key not valid. Please pass a valid API key.","errors":[{"message":"API key not valid. Please pass a valid API key.","domain":"global","reason":"badRequest"}],"status":"INVALID_ARGUMENT","details":[{"#type":"type.googleapis.com/google.rpc.ErrorInfo","reason":"API_KEY_INVALID","domain":"googleapis.com","metadata":{"service":"identitytoolkit.googleapis.com"}}]}}
this means you are trying to run app on web chrome and in your flutter app this is not configure so follow below steps:
1. Go to https://console.firebase
2. Select your project name i.e. "E-Commerce App"
3. Select Add App option from dashboard select platform (flutter/android/ios/web) from this select flutter
4. Add Firebase to your Flutter app this screen will open then select next
5. From any directory, run this command:"dart pub global activate flutterfire_cli"
6. Then, at the root of your Flutter project directory, run this command:"flutterfire configure --project=eshop-a44ca"
7. After "flutterfire configure" check npm
add this in main.dart file:
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
8. Run this command in your project directory npm install -g firebase-tools
9.Again run this command ""flutterfire configure --project=eshop-a44ca" you will see below screen [firebase options file created in lib folder]
9. now you can sign up/register user successfully
10. [user created on firestore database ]
[1]: https://i.stack.imgur.com/NBiDz.png
Whenever I use following command in terminal (mac os sierra)
firebase init
below three option will be displayed
❯◯ Database: Deploy Firebase Realtime Database Rules
◯ Functions: Configure and deploy Cloud Functions
◯ Hosting: Configure and deploy Firebase Hosting sites
If I select nothing and press Enter
I will get below message
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, skipping
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
✔ Firebase initialization complete!
But when I select second option
◯ Functions: Configure and deploy Cloud Functions
I will get below message
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, skipping
=== Functions Setup
A functions directory will be created in your project with a Node.js
package pre-configured. Functions can be deployed with firebase deploy.
Error: HTTP Error: 401, The entered credentials were incorrect.
Amits-MacBook-Pro:firebase-functions Amit$
I have tried with firebase logout and then firebase login again but same error is coming
I have also used firebase list
I got below warning and then I got list of project
Amits-MacBook-Pro:firebase-functions Amit$ firebase list
Warning: advanced compression encodings unavailable without ES6/C++11. Falling back to gzip.
Since long time ago I have used firebase function with another google login, now I am logout from that and started to login with different google login account but unable to do it, if I login with previouse google login still it's not working
I have also check directory where I have used firebase init no files are creating in that directory.
In demo of Firebase function they have shown that some files are created
https://www.youtube.com/watch?v=EvV9Vk9iOCQ&t=308s
Should I uninstall firebase and install it again? if yes, just let me know how to uninstall?
I had the same Firebase Error: "HTTP Error: 401, The entered credentials were incorrect" when I was authenticated with the wrong Google account.
I did firebase login --reauth and logged in with the right account.
After that, the project was successfully deployed.