繁体   English   中英

无法解析符号GOOGLE_SIGN_IN_API。.我的应用程序中的Google登录,无法访问变量Auth.GOOGLE_SIGN_IN_API

[英]Cannot resolve symbol GOOGLE_SIGN_IN_API.. Google sign-in in my app, Unable to access variable Auth.GOOGLE_SIGN_IN_API

我一直在将Google登录功能集成到我的Android应用程序中。 我一直在关注Google提供的Android教程。 https://developers.google.com/identity/sign-in/android/sign-in )在此过程中,我遇到了这个问题。

//建立可访问Google登录API和gso指定的//选项的GoogleApiClient。

mGoogleApiClient = new GoogleApiClient.Builder(this)
    .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)
    .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
    .build();

无法解析符号GOOGLE_SIGN_IN_API,这是我面临的问题。

我一直严格遵守上述链接中所述的所有步骤。 所有依赖项和插件都相同,但问题仍然存在。 如何解决此问题并继续前进? 任何答案将不胜感激。

***************更新*************** 这是我的应用程式

 apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion '25.0.0' packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/dependencies.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/license.txt' exclude 'META-INF/LGPL2.1' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/notice.txt' } dexOptions { javaMaxHeapSize "4g" } defaultConfig { applicationId 'com.cloudtree.glue' minSdkVersion 16 targetSdkVersion 23 versionCode 3 versionName "1.2" renderscriptTargetApi 19 renderscriptSupportModeEnabled true multiDexEnabled true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' lintOptions { disable 'MissingTranslation' } } } productFlavors { } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile files('libs/google-play-services.jar') compile 'com.android.support:design:23.0.1' compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.daimajia.swipelayout:library:1.2.0@aar' compile 'com.android.support:recyclerview-v7:23.0.1' compile 'com.android.support:cardview-v7:23.0.1' compile 'com.android.support:multidex:1.0.0' compile files('libs/httpclient-4.2.1.jar') compile files('libs/httpcore-4.2.1.jar') compile files('libs/apache-mime4j-core-0.7.2.jar') compile files('libs/httpmime-4.2.1.jar') compile project(':volley') compile project(':mediapicker') compile 'com.android.support:support-v4:18.0.+' compile 'com.google.android.gms:play-services-auth:9.8.0' } apply plugin: 'com.google.gms.google-services' 

这是我的项目摇篮

 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' classpath 'com.google.gms:google-services:3.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } 

更新您的gradle文件

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

以此替换您的gradle依赖性,如有任何查询,请通知我

compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.daimajia.swipelayout:library:1.2.0@aar'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.android.support:multidex:1.0.0'
compile files('libs/httpclient-4.2.1.jar')
compile files('libs/httpcore-4.2.1.jar')
compile files('libs/apache-mime4j-core-0.7.2.jar')
compile files('libs/httpmime-4.2.1.jar')
compile project(':volley')
compile project(':mediapicker')
compile 'com.android.support:support-v4:18.0.+'
compile 'com.google.android.gms:play-services-auth:9.8.0'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM