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

前端 未结 2 1964
醉酒成梦
醉酒成梦 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 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

提交回复
热议问题