parohy
parohy

Reputation: 2180

com.google.firebase.FirebaseException: An internal error has occurred. [ CONFIGURATION_NOT_FOUND ]

Ok so I get the following exception. No idea why it is happening. I have followed the guides how to set up auth for google account. I tried to search the google but no success of any solution for this. I haved tried to search for the CONFIGURATION_NOT_FOUND but I could not find it in the firebase docs. I don't know what configuration he can't find. Exception is basically useless. Signing in trough firebase is going great until authenticating it with firebase:

private void authenticateGoogleAccount(GoogleSignInAccount account) {
    AuthCredential credential = GoogleAuthProvider.getCredential(account.getIdToken(), null);
    mAuth.signInWithCredential(credential)
            .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
                @Override
                public void onComplete(@NonNull Task<AuthResult> task) {
                    if (!task.isSuccessful()) {
                        Log.w(TAG, "signInWithCredential", task.getException());
                        Toast.makeText(MainActivity.this, "Authentication failed.",
                                Toast.LENGTH_SHORT).show();
                    }
                    else {
                        Log.d(TAG, "signInWithCredential");
                    }
                }
            });
}

Google sign-in-method is enabled in the firebase console. yes I have found a duplicate of this answer but has 0 answers and one unanswered comment 5 months ago.

Upvotes: 57

Views: 77429

Answers (15)

bara batta
bara batta

Reputation: 1234

you might look into this : Github issue

Obtain your API Key:

  • Visit the Google Cloud Console at Credentials Page.
  • Locate Android key (auto created by Firebase) and click SHOW KEY to retrieve your API_KEY.

Check Your Authorized Domains:

Go to: https://www.googleapis.com/identitytoolkit/v3/relyingparty/getProjectConfig?key=API_KEY

You should see a JSON response that includes something like:

{
"projectId": "PROJECT_ID",
  "authorizedDomains": [
  "localhost",
  "project-id.firebaseapp.com",
  "project-id.web.app"
  ]
}

In my case, authorizedDomains was empty (which should normally be auto-created by Firebase).

Solution: Go to: https://console.firebase.google.com/u/3/project/project-id/authentication/settings Then go to: Authorized domains

add the following domains:

  • "localhost",
  • "project-id.firebaseapp.com",
  • "project-id.web.app"

Make sure to replace project-id with your actual project identifier (found in your Firebase project URL).

Once these domains are listed in Firebase’s auth settings, your application should function correctly.

Upvotes: 0

吴张明
吴张明

Reputation: 379

Same, but I do spent some time to find the enterence. Here is the 2 steps: enter image description here

enter image description here

Upvotes: 0

Santironhacker
Santironhacker

Reputation: 1004

Might sound obvious but make sure your firebase SDK config that you set up in your app points to the correct project.

Firebase config SDK can be found at:

  1. Login to your firebase console on the browser
  2. Select project
  3. Gear --> project setting
  4. Scroll to SDK setup and configuration

Example of firabaseConfig:

const firebaseConfig = {
  apiKey: "make sure it points to the correct project",
  authDomain: "PROJECT_ID.firebaseapp.com",
  projectId: "PROJECT_ID",
  storageBucket: "PROJECT_ID.firebasestorage.app",
  messagingSenderId: "whatever",
  appId: "whatever"
};

Upvotes: 0

Moti Bartov
Moti Bartov

Reputation: 3592

Make sure you run the flutterfire configure command and follow the instructions

https://firebase.google.com/docs/flutter/setup

Upvotes: 0

Please check in /android/build.gradle:

buildscript {
  dependencies {
    // ... other dependencies
    classpath 'com.google.gms:google-services:4.3.14'
  }
}

if the version of google-services is the newest or not (visit https://rnfirebase.io/ to see the newest version if you use that library). Update google-services to the newest that solve my problem.

Upvotes: 0

This error appears if you have not clicked through the interstitial hero in the admin UI. Simply go to the "Authentication" tab of your project and click "Get Started". If you are using custom authentication, no further configuration is required; Google simply fails to properly initialize your project at first.

(Thanks to @Lahiru Chandima for the pointer.)

Upvotes: 5

Andrel Sitanggang
Andrel Sitanggang

Reputation: 1

for my case, check the appIdSuffix. is the suffix already on Apps in firebase /settings/general page? the google-services.json should contain it suffix

additional: if you already have existing build(app/build folder and so on), remove it first

Upvotes: 0

hamid saifi
hamid saifi

Reputation: 464

I was having the same issue with my MacBook with M1 chip my emulator date and time were not correct. Setting up them manually saved my day.

Upvotes: 0

Adam Smaka
Adam Smaka

Reputation: 6393

some people have like google-services (4).json in their project. rename the file to google-services.json and you will be fine

Upvotes: 0

Andres Casta&#241;eda
Andres Casta&#241;eda

Reputation: 210

This happened to me in an Android emulator on my Mac M1 developing an app in Flutter, what happened was that the date and time on my Android Emulator was completely out. A cold boot reset the date and time and the Firebase exception issue was solved.

Upvotes: 4

Ali Mohamed Ghazal
Ali Mohamed Ghazal

Reputation: 41

just head to your project settings in firebase and enable email/password auth

Upvotes: 4

Aman
Aman

Reputation: 2393

Check if you enabled the authentication type you want in the firebase console.

enter image description here

Upvotes: 148

Ishan Hettiarachchi
Ishan Hettiarachchi

Reputation: 1704

Enabling Sign-in method (email/password in my case) in Firebase project dashboard fixed the issue for me.

enter image description here

Upvotes: 25

user7176550
user7176550

Reputation: 1541

If your Firebase one project contail multiple application then download google-service.json file from app->setting->google-service.json and then add in your android studio project.

Upvotes: 0

Jin Liu
Jin Liu

Reputation: 2263

Have you checked the project_id in your Android app google-services.json file is the same as the Firebase project for which you enabled Google Sign In Authentication? If that is the case and you have not edited the google-services.json file, you can file a support ticket to Firebase.

Upvotes: 19

Related Questions