I have just started using Firebase Authentication, I followed few tutorials including Firebase's docs, but no matter what I do, FirebaseAuth.getInstance() always returns null.
After trying for a long time, I decided to delete everything I've done related to the Authentication, and start it over, so that I only use the declaration of the FirebaseAuth variable and its initialization, as in the following:
In the class variables initialization: 

```
private FirebaseAuth mAuth;

```

And then in the onCreate() method I called a method which initializes firebase's variables and references, so I call the following method:

```
private void initFirebase()     //initialize firebase
    {
        FirebaseApp.initializeApp(this);
        mAuth = FirebaseAuth.getInstance();
        mFirebaseDatabase=FirebaseDatabase.getInstance();
        mDatabaseReference=mFirebaseDatabase.getReference().child("users");
        mEventsReference=mFirebaseDatabase.getReference().child("events");
        mStorageRef= FirebaseStorage.getInstance().getReference();
        defaultRef = mStorageRef.child("usersProfilePic/");             //Assigning default reference for storage
    }

```

My dependencies in the build.gradle are:

```
apply plugin: 'com.android.application'

android {
    compileSdkVersion 28

    /*dataBinding {
        enabled = true;
    }*/
    defaultConfig {
        applicationId "com.example.android.aln4"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        multiDexEnabled true
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //noinspection GradleCompatible
    testImplementation 'junit:junit:4.12'

    //google maps api
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-places:16.0.0'

    //Firebase
    implementation 'com.google.firebase:firebase-crash:16.2.1'
    implementation 'com.firebase:firebase-client-android:2.5.2'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-database:16.0.6'
    implementation 'com.firebase:firebase-client-android:2.5.2'
    implementation 'com.firebaseui:firebase-ui-database:2.1.1'
    implementation 'com.google.firebase:firebase-storage:16.0.5'
    implementation 'com.google.firebase:firebase-firestore:18.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.google.firebase:firebase-auth:16.1.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'

    //Calendar
    implementation 'com.github.alamkanak:android-week-view:1.2.6'
    implementation 'com.github.sundeepk:compact-calendar-view:3.0.0'
    implementation 'com.github.khacpv:Calendar-Day-View:1.0.5'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    //Image tools
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'de.hdodenhof:circleimageview:2.1.0'
    //Validation
    implementation 'com.basgeekball:awesome-validation:2.0'
    //Notification badge
    implementation 'com.nex3z:notification-badge:0.1.0'
    //Others
    implementation 'com.kevin:loopview:1.4.1'

    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

```

In the Firebase authentication website itself, I've already enabled the Authentication service in the sign-in method.

So, if anyone can tell me what is wrong here, I'd love that since I've spent the last 6 hours trying to figure it out...