Firebaseui-android: Compatability issue (crash) with SDK 10.2.0

Created on 18 Feb 2017  路  7Comments  路  Source: firebase/FirebaseUI-Android

  • Android device: Pixel XL
  • Android OS version: 7.1.1
  • Google Play Services version: 10.2.98
  • Firebase/Play Services SDK version: 10.2.0
  • FirebaseUI version: 1.1.1

FirebaseUI 1.1.1 causes a crash with the new Firebase SDK 10.2.0:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.firebase.udacity.friendlychat, PID: 17822
java.lang.NoSuchMethodError: No virtual method zzqJ()Ljava/util/ArrayList; in class Lcom/google/android/gms/auth/api/signin/GoogleSignInOptions; or its super classes (declaration of 'com.google.android.gms.auth.api.signin.GoogleSignInOptions' appears in /data/app/com.google.firebase.udacity.friendlychat-2/base.apk:classes13.dex)
at com.google.android.gms.auth.api.Auth$3.zza(Unknown Source)
at com.google.android.gms.auth.api.Auth$3.zzp(Unknown Source)
at com.google.android.gms.common.api.GoogleApiClient$Builder.addApi(Unknown Source)
at com.firebase.ui.auth.provider.GoogleProvider.(GoogleProvider.java:84)
at com.firebase.ui.auth.provider.GoogleProvider.(GoogleProvider.java:54)
at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.populateIdpList(AuthMethodPickerActivity.java:96)
at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.onCreate(AuthMethodPickerActivity.java:80)
at android.app.Activity.performCreate(Activity.java:6679)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Downgrading to Firebase SDK 10.0.1 (the most recent listed version in the FirebaseUI compatibility table) resolves the problem. I am aware that 10.2.0 isn't listed in the table (so it should come as no surprise it may not work), but this is the recommended version from the Firebase Android SDK page, so a warning at least for new users in the Readme might be useful until a patch is ready.

fix-implemented bug

All 7 comments

Make sure to include all auth dependencies to ensure you are overriding FirebaseUI's dependencies:

compile "com.google.firebase:firebase-core:$playServicesVersion"
compile "com.google.firebase:firebase-auth:$playServicesVersion"
compile "com.google.android.gms:play-services-auth:$playServicesVersion"

Working dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:multidex:1.0.1'

    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.google.firebase:firebase-storage:10.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-config:10.0.1'
    compile 'com.firebaseui:firebase-ui-auth:1.1.1'
}

apply plugin: 'com.google.gms.google-services'

Non-working dependencies:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:appcompat-v7:24.2.0'
    compile 'com.github.bumptech.glide:glide:3.6.1'
    compile 'com.android.support:multidex:1.0.1'

    compile 'com.google.firebase:firebase-database:10.2.0'
    compile 'com.google.firebase:firebase-auth:10.2.0'
    compile 'com.google.firebase:firebase-storage:10.2.0'
    compile 'com.google.firebase:firebase-messaging:10.2.0'
    compile 'com.google.firebase:firebase-config:10.2.0'
    compile 'com.firebaseui:firebase-ui-auth:1.1.1'
}

apply plugin: 'com.google.gms.google-services'

This is the offending line of Java:

@Override
protected void onResume() {
    super.onResume();
    mFirebaseAuth.addAuthStateListener(mAuthStateListener);
}

The above method works fine with the working dependencies, but crashes with the non-working ones.

@redbassett Please add the dependencies I asked you to try:

compile "com.google.firebase:firebase-core:$playServicesVersion"
compile "com.google.firebase:firebase-auth:$playServicesVersion"
compile "com.google.android.gms:play-services-auth:$playServicesVersion"

@SUPERCILEX your code fixed the issue, Thanks !

Using the dependencies described here I get the following exception on app start:
java.lang.VerifyError: Verifier rejected class com.google.firebase.crash.FirebaseCrash due to bad method void com.google.firebase.crash.FirebaseCrash.zza(java.lang.String, long, android.os.Bundle)
Should I wait for the 1.2.0 release?

@peterhav for guaranteed compatibility with the 10.2.0 Play services SDK, yes you will have to wait for the 1.2.0 release.

The fix for this issue has been released in version 1.2.0.

Was this page helpful?
0 / 5 - 0 ratings