android - 在 android Activity 中使用 PLUS.API 的依赖关系

标签 android gradle google-signin

mGoogleApiClient = new GoogleApiClient.Builder(this)
            .enableAutoManage(this, onConnectionFailedListener)
            .addApi(Auth.GOOGLE_SIGN_IN_API, gso)
            .addApi(Plus.API, null)
            .build();

我错过了什么?我无法弄清楚应该添加什么依赖项。 请帮忙。 AndroidStudio 无法解析 PLUS.API 这是我的 gradle 文件:

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

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    defaultConfig {
        applicationId "in.co.palup.android"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),       'proguard-rules.pro'
        }
    }
}

repositories {
    mavenLocal()
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.google.android.gms:play-services-location:8.3.0'
    compile "com.android.support:support-v4:23.1.1"
    compile "com.android.support:support-v13:23.1.1"
    compile "com.android.support:cardview-v7:23.1.1"
    compile 'com.android.support:support-v4:23.1.1'

    compile 'com.google.code.gson:gson:2.4'
    compile 'joda-time:joda-time:2.9'

    compile "palup:common:0.1"
    compile 'com.google.android.gms:play-services-appindexing:8.3.0'
    compile 'com.google.android.gms:play-services-auth:8.3.0'
}

我错过了什么?我无法弄清楚我应该使用什么依赖项。 请帮忙。

最佳答案

你的 gradle 依赖项会不会丢失

com.google.android.gms:play-services-plus:8.3.0

https://developers.google.com/android/guides/setup

关于android - 在 android Activity 中使用 PLUS.API 的依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34113249/

相关文章:

gradle - 在gradle中配置Maven等效存储库

java - 无法在 Android 应用程序中使用 Google 登录

android - 在 build.gradle 上添加存储库的位置和原因

android - 如何使用 Gradle 在 Intellij Idea 中将 Android 项目设置为子项目

php - 需要通过php文件更改mysqli_query输出格式

android - 在Android ActivityInstrumentationTestCase2中模拟一个fling手势

java - 使用 Android Studio 生成的 APK 未安装在某些设备上

html - Google Identity Toolkit - 登录后出现 Google 登录错误 400

java - 如何从 Android 中的应用程序中注销用户

android - 在包 'MvxBind' 中找不到属性 'AndroidApp.Droid' 的资源标识符