Failed resolution of: Lcom/google/android/gms/common/api/Api$zzf;

后端 未结 7 1308
萌比男神i
萌比男神i 2021-02-13 14:12

I got this error when we run apk file of our application. In build.gradle we set multidex and compile multidex is existed in Gradle file . We changed the version of

相关标签:
7条回答
  • 2021-02-13 14:54

    I was having this issue when i enabled proguard, when i'm disabling it I don't get the crash. I fixed it by adding following dependencies in my app level gradle. I have used FCM, Firebase Analytics and google location in my app. So I had to add the following, if u r not using anything then skip it.

    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:20.2.0'
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    

    Also add the following in your proguard rules file.

    -dontshrink
    -dontoptimize
    -dontwarn
    -dontpreverify
    
    0 讨论(0)
  • 2021-02-13 15:04

    For me i tried adding implementation 'com.google.android.gms:play-services-auth:18.0.0' didnot work for me..

    But after adding the below dependency it worked for me.

    implementation 'com.android.support:multidex:1.0.3'

    0 讨论(0)
  • 2021-02-13 15:05

    This is happen when we try to authenticate user with some authenticate service like AccountKit FirebaseAuth and those service depends on play-services-auth So, Add

    implementation 'com.google.android.gms:play-services-auth:16.0.0'
    

    on your build.gradle dependencies

    0 讨论(0)
  • 2021-02-13 15:11

    Well, I am using Account Kit from Facebook. After I adding play-services-auth problem is resolved.

    implementation 'com.facebook.android:account-kit-sdk:4.39.0'
    
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    
    0 讨论(0)
  • I was using a react native package

    react-native-facebook-account-kit
    

    resolved by adding

    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    
    0 讨论(0)
  • 2021-02-13 15:15

    I fixed this issue. Please follow below code. Added following to android/build.gradle

    allprojects {
        repositories {
        //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
         jcenter()
           maven {
             url "https://maven.google.com"
           }
         }
     }
    
    0 讨论(0)
提交回复
热议问题