2
votes

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 googlex0r
I have tried this too. I am always getting "Authentication failed." errorNur

2 Answers

3
votes

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.

0
votes

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