FirebaseUI-Android: Crash in AuthUI.getInstance() while Signin

  • Android device: vivo X9
  • Android OS version: 6.0.1
  • Google Services version: 3.1.2
  • Firebase/Play Services SDK version: 11.8.0
  • FirebaseUI version: 3.1.3

The problem:

Crash in AuthUI.getInstance() while signin

Crash report

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.android.gms.common.api.GoogleApi.zzb(com.google.android.gms.common.api.internal.zzdd)' on a null object reference
com.google.android.gms.internal.zzdvv.zzb (Unknown Source)
com.google.android.gms.internal.zzdwc.setFirebaseUIVersion (Unknown Source)
com.google.firebase.auth.FirebaseAuth.setFirebaseUIVersion (Unknown Source)
com.firebase.ui.auth.AuthUI.getInstance (AuthUI.java:192)
com.firebase.ui.auth.AuthUI.getInstance (AuthUI.java:179)

Code to reproduce

        startActivityForResult(AuthUI.getInstance()
                .createSignInIntentBuilder()
                .setLogo(R.mipmap.ic_launcher)
                .setIsSmartLockEnabled(false)
                .setAvailableProviders(
                        arrayListOf(AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build()))
                .setTheme(R.style.LoginTheme)
                .setLogo(R.drawable.logo)
                .build(),
                requestCode)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 20 (6 by maintainers)

Most upvoted comments

Yeah, this has been fixed in 3.3.

Hey all, I have deobfuscated the stack trace and am chasing this down internally.

hey! it worked for me with this configurations in app/build.gradle

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.bla.bla.appname"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    // Facebook Android SDK (everything)
    compile 'com.facebook.android:facebook-android-sdk:4.28.0'
    // Include all the Twitter APIs
    //compile 'com.twitter.sdk.android:twitter:3.1.1'
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.firebase:firebase-storage:11.8.0'
    compile 'com.firebaseui:firebase-ui:3.1.3'
    compile 'com.google.android.gms:play-services-auth:11.8.0'

}

AND in the app

startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder()
                    .setLogo(R.mipmap.ic_launcher)
                    .setIsSmartLockEnabled(false, true)
                    .setAvailableProviders(
                            Arrays.asList(
                                    new AuthUI.IdpConfig.Builder(AuthUI.FACEBOOK_PROVIDER).build(),
                                    new AuthUI.IdpConfig.Builder(AuthUI.GOOGLE_PROVIDER).build(),
                                    new AuthUI.IdpConfig.Builder(AuthUI.EMAIL_PROVIDER).build()))
                    //.setIsSmartLockEnabled(false, true)
                    .setLogo(R.drawable.namelogo)
                    .build(), RC_SIGN_IN);

Hey all.

A fix for this bug has been submitted internally, so this should be fixed in the next 1-2 Firebase Auth SDK releases depending on the release cycle.

I am going to close this issue here since there’s nothing more FIrebaseUI can do, thanks for everyone who reported it!

try to run it without the theme, if it solves the problem move the theme above the providers. for instance when i moved the smart lock it stop crashes on the phone.