无法解析新Android Studio项目上的符号GooglePlayServicesClient

无法解析新Android Studio项目上的符号GooglePlayServicesClient,android,android-studio,google-play-services,Android,Android Studio,Google Play Services,我刚刚安装了Android Studio 1.1.0并创建了一个新项目。我用一个登录活动创建了它,包括Google+登录 项目一打开,我就在PlusBaseActivity.java中看到许多错误。这似乎是因为com.google.android.gms.common.GooglePlayServiceClient没有被导入 我根本没有更改代码,不知道为什么默认情况下它没有运行。我怎样才能把它导入 build.gradle apply plugin: 'com.android.applicati

我刚刚安装了Android Studio 1.1.0并创建了一个新项目。我用一个登录活动创建了它,包括Google+登录

项目一打开,我就在
PlusBaseActivity.java
中看到许多错误。这似乎是因为
com.google.android.gms.common.GooglePlayServiceClient
没有被导入

我根本没有更改代码,不知道为什么默认情况下它没有运行。我怎样才能把它导入

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "us.grahn.logintest"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.google.android.gms:play-services:7.0.0'
}

GooglePlayServicesClient
类已被弃用一段时间。随着谷歌最新发布的PlayServices,我相信他们完全摆脱了它

但是,AndroidStudio中的演示项目仍然使用旧API,因此无法编译:(

从本质上讲,与Google PlayServices交谈时,您应该使用now(如本文所述)

比如:

GoogleApiClient googleApiClient = new GoogleApiClient.Builder(this)
            .addApi(Plus.API)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .build();

................

googleApiClient.connect();

@PavelDudka我已经包含build.gradle文件。我根本没有编辑过这个文件。为Android开发很糟糕。我必须每隔几个月完成一次重写我正在处理的项目,因为IDE和SDK的更改完全破坏了一切。我已经在我的项目上坐了5个小时,试图用更新的IDE重新编译它。我我非常期待iphoneimplementation@John留住我们posted@John使用干净的体系结构,这样您只需在一个类中更改代码。