Biiiiiird Biiiiiird - 7 months ago 35
Android Question

Android Firebase's createUser failing: handler always calling onError

I'm trying to create a new user in Firebase but onError is constantly being called by my ValueResultHandler:

public void onSignUpComplete(String email, String password) {
Firebase ref = new Firebase(Constants.FIREBASE_URL); // this is ""
ref.createUser(email, password, new SignUpResultHandler());

class SignUpResultHandler implements Firebase.ValueResultHandler<Map<String, Object>> {
public void onSuccess(Map<String, Object> StringObjectMap) {
Toast.makeText(getApplicationContext(), "Created User!", Toast.LENGTH_SHORT().show();
public void onError(FirebaseError firebaseError) {
Toast.makeText(getApplicationContext(), "Failed to create user! " +
firebaseError.getDetails(), Toast.LENGTH_SHORT).show();

I always get the toast "Failed to create user!" and an empty return from

Some extra information: Email and password authentication is enabled in Firebase and my manifest has a uses-permission for
. I have firebase-auth:9.4.0, firebase-core:9.4.0, firebase-database:9.4.0 and firebase-client-android:2.5.2 as dependencies (and play services). I have my google-services.json file in the app folder and the plugin applied in gradle. I'm running the app in a connected device but this also fails on an emulator.


Looks like you're following old Firebase documentation. new Firebase() method is deprecated as of May 18, 2016 and the url will be handled by the json file, so we do not need to define it. Here is the link for steps with new documentation: Create a password-based account.