无法解析GoogleSignIn和GoogleSignInClient [英] Cannot resolve GoogleSignIn and GoogleSignInClient
问题描述
我无法使用GoogleSignIn( com.google.android.gms.auth.api.signin.GoogleSignIn )和GoogleSignInClient( com.google.android.gms.auth.api.signin.GoogleSignInClient ),同时在Android Studio中实现Google登录,同时我可以访问App中的其他类,例如
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;
我的build.gradle(app)文件的精简版如下
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'
我的build.gradle(package)是
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'
}
}
任何帮助将不胜感激
推荐答案
将此添加到您的应用级依赖项
add this to your app-level dependency
compile 'com.google.android.gms:play-services-auth:12.0.1'
这篇关于无法解析GoogleSignIn和GoogleSignInClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!