Flutter: FirebaseException: An internal error has occurred. [ CONFIGURATION_NOT_FOUND ]

Viewed 4797

I was able to do google sigin successfully, when I pass token to firebase it returns :

W/System  (20511): Ignoring header X-Firebase-Locale because its value was null.
I/flutter (20511): [firebase_auth/unknown] com.google.firebase.FirebaseException: An internal error has occurred. [ CONFIGURATION_NOT_FOUND ]

My json file is quite good. I implement :

final _auth = FirebaseAuth.instance;
  String email;
  String password;

RoundButton(
                title: 'register',
                color: Colors.blueAccent,
                onPressed: () async {
                  try {
                    final newUser = await _auth.createUserWithEmailAndPassword(
                        email: email, password: password);
                    if (newUser != null) {
                      Navigator.pushNamed(context, ChatScreen.id);
                    }
                  } catch (e) {
                    print(e);
                  }
                })
2 Answers

This can be caused by a disabled Email/Password sign in, which is disabled by default. Enable on the Authentication section in firebase console as shown below.enter image description here

My solution was different because I had to change the Firebase project I was using and therefore swap out the google-services.json file in my project.

I realized it kept trying to communicate with the old Firebase project so I had to delete app/build and run the project again. I restarted VSCode too, but I don't know if that is necessary.

Hope this helps anyone else that was in my situation.

Related