2

I am getting the following error:

Projects created at console.firebase.google.com must use the new Firebase Authentication SDKs available from firebase.google.com/docs/auth/

Though I have included recent version firebase authentication in my gradle file:

compile 'com.google.firebase:firebase-auth:9.0.2'

This code was working fine in one my firebase project. But after adding this into another project in firebase,I'm facing the error.Please help me out.

            myFirebaseRef.createUser(
                    doctor.getEmail(),
                    doctor.getPass(),
                    new Firebase.ValueResultHandler<Map<String, Object>>() {
                        @Override
                        public void onSuccess(Map<String, Object> stringObjectMap) {
                            doctor.setId(stringObjectMap.get("uid").toString());
                            doctor.saveUser(myFirebaseRef);
                            Doctor_info doc=new Doctor_info();
                            doc.setGender(gender);

                            myFirebaseRef.child("doctor_info").push().setValue(doc);

                            myFirebaseRef.unauth();
                            Toast.makeText(getApplicationContext(), "Your Account has been Created", Toast.LENGTH_LONG).show();
                            Toast.makeText(getApplicationContext(), "Please Login With your Email and Password", Toast.LENGTH_LONG).show();

                            finish();
                        }
2
  • did you try using createUserWithEmailAndPassword method ? This is an example by google Commented Jun 24, 2016 at 9:57
  • I have tried this too. I am always getting "Authentication failed." error Commented Jun 24, 2016 at 10:08

2 Answers 2

3

Projects that are created at firebase.google.com, can only use the Firebase Authentication SDKs available from https://firebase.google.com/docs/auth/.

You're using a Firebase 2.x SDK, specifically this createUser() method.

The fact that you're including a dependency on the new Firebase is not enough, you likely also have a dependency on Firebase for Android 2.x somewhere (e.g. compile 'com.firebase:firebase-client-android:2.5.2+'), which you'll need to remove.

Sign up to request clarification or add additional context in comments.

4 Comments

If I remove 'com.firebase:firebase-client-android:2.5.2+' what will happen to my Firebase object? that are importing com.firebase.client.Firebase;
What to do if I don't want to use new SDKs?
If you already have an existing project on the legacy Firebase console, you can continue to use that with the 2.x SDKs. But projects that are created at firebase.google.com, can only use the Firebase Authentication SDKs available from firebase.google.com/docs/auth.
@frank-van-puffelen This error also happens on server applications using Firebase 2. The funny part is applications create using Firebase Legacy and migrated to to Google Firebase work perfectly.
0

I solved this problem so:

  1. "Upgrade your Android app from Firebase.com"
  2. Press in console "Add Firebase to your Android app" enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.