Cannot resolve GoogleSignIn and GoogleSignInClient

pcforgeek picture pcforgeek · Nov 10, 2017 · Viewed 25.2k times · Source

I am not able to use GoogleSignIn(com.google.android.gms.auth.api.signin.GoogleSignIn ) and GoogleSignInClient(com.google.android.gms.auth.api.signin.GoogleSignInClient ) while implementing Google Sign In in Android Studio while I can access other classes in App like

com.google.android.gms.auth.api.signin.GoogleSignInAccount;
com.google.android.gms.auth.api.signin.GoogleSignInOptions;
com.google.android.gms.common.SignInButton;

A strip down version of my build.gradle(app) file is as follow

android {

}

dependencies {

    compile 'com.google.android.gms:play-services-auth:11.4.2'
    compile('com.google.api-client:google-api-client-android:1.23.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    compile('com.google.apis:google-api-services-gmail:v1-rev72-1.23.0') {
        exclude group: 'org.apache.httpcomponents'
    }
    implementation 'com.google.gms:google-services:3.1.2'
}

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

and my build.gradle(package) is

buildscript {

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath 'com.google.gms:google-services:3.1.2'
    }
}

Any help would be appreciated

Answer

Toe Pyae Sone Oo picture Toe Pyae Sone Oo · Dec 17, 2017

add this to your app-level dependency

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