Firebase AuthUI: NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/zzbgl

前端 未结 2 1929
醉酒成梦
醉酒成梦 2021-01-28 21:07

My App crashes whenever I call this code:

if (FirebaseAuth.getInstance().getCurrentUser() == null) {
        startActivityForResult(
                AuthUI.getIn         


        
相关标签:
2条回答
  • 2021-01-28 21:57

    Change this:

    compile 'com.firebaseui:firebase-ui-auth:3.3.0'
    

    into this:

    compile 'com.firebaseui:firebase-ui-auth:4.0.0'
    

    from the docs:

    As of version 4.0.0, FirebaseUI has the following dependency versions:

    Library Version
    firebase-auth   16.0.1
    play-services-auth  15.0.1
    firebase-database   16.0.1
    firebase-firestore  17.0.1
    firebase-storage    16.0.1
    

    more info here:

    https://github.com/firebase/FirebaseUI-Android#dependencies

    0 讨论(0)
  • 2021-01-28 22:02

    I had same issue, after trying lots of things, this fixed this issue for me:

    I modified my build.gradle on allProjects{} and added the following

    allprojects {
      repositories {
        google()
        jcenter()
       //start here
        configurations.all {
            resolutionStrategy.eachDependency { DependencyResolveDetails details ->
                def requested = details.requested
                if (requested.group == 'com.google.android.gms') {
                    details.useVersion '12.0.1'
                }
                if (requested.group == 'com.google.firebase') {
                    details.useVersion '12.0.1'
                }
            }
        }
        //end
      }
    }
    

    source here

    0 讨论(0)
提交回复
热议问题