Cannot resolve GoogleSignIn and GoogleSignInClient

后端 未结 5 511
故里飘歌
故里飘歌 2021-01-17 10:02

I am not able to use GoogleSignIn(com.google.android.gms.auth.api.signin.GoogleSignIn ) and GoogleSignInClient(com.google.android.gms.auth.api.signin.GoogleSign

相关标签:
5条回答
  • 2021-01-17 10:29

    add this to your app-level dependency

    compile 'com.google.android.gms:play-services-auth:12.0.1'
    
    0 讨论(0)
  • 2021-01-17 10:30

    Can't you use any newer version? e.g. 11.6.0. Try to update your Google Repository as well. (Tools->Android->SDK Manager->SDK Tools under Support Repository)

    0 讨论(0)
  • 2021-01-17 10:33

    For me I was applying a plugin for the google play services in my app's build.gradle:

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

    along with that in my Project's Build.gradle I had google services.

    buildscript {
        ext.kotlin_version = '1.1.60'
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.google.gms:google-services:3.1.2' // <== this guy
            classpath 'com.android.tools.build:gradle:3.0.0'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
            classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    

    I remember I added them with some compiling issues. But apparently I didn't need them.

    By removing them I found there were no more issues with the gms versions.

    EDIT

    So removing solved my issue initially, but gave me issues later with google sign in. adding the apply plugin: 'com.google.gms.google-services' to the bottom of my projects gradle instead of at the top did actually solve it.

    0 讨论(0)
  • 2021-01-17 10:41

    In the build.gradle Module script, I had to add these two dependencies, then "Sync Now" and issue resolved for me.

    dependencies {  
        // Your own command lines
        //...
    
        compile 'com.google.android.gms:play-services-drive:11.8.0'
        compile 'com.google.android.gms:play-services-auth:11.8.0'
    }
    
    0 讨论(0)
  • 2021-01-17 10:47

    I was having the same issue

    GoogleSignIn and GoogleSignInClient were introduced in version Google Play services SDK version 11.6. In older versions GoogleApiClient was used.

    So try changing the compile 'com.google.android.gms:play-services-auth:11.4.2' to 'com.google.android.gms:play-services-auth:12.0.1' in dependencies

    dependencies { compile 'com.google.android.gms:play-services-auth:12.0.1' }

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