无法解析符号“GooglePlayServicesClient" [英] Cannot resolve symbol 'GooglePlayServicesClient'

查看:48
本文介绍了无法解析符号“GooglePlayServicesClient"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将项目从 Eclipse 迁移到 Android Studio,该项目可以在 Eclipse 中构建并成功导入到 Android Studio,但是,我收到 Cannot resolve symbol 'GooglePlayServicesClient' 错误安卓工作室.

I am trying to migrate a project from Eclipse to Android Studio, the project can be build in Eclipse and was successful imported to Android Studio, however, I get Cannot resolve symbol 'GooglePlayServicesClient' error in Android Studio.

我按照官方教程在Android Studio中导入了Google Play服务,我的项目中使用的另一个包com.google.android.gms.common.ConnectionResult"没有相同问题.只有GooglePlayServicesClient"无法解析.

I followed the official tutorial to imported Google Play service in Android Studio, and an other package "com.google.android.gms.common.ConnectionResult" that used in my project does not have same issue. Only 'GooglePlayServicesClient' cannot be resolved.

我也尝试过清理和重建我的项目,但问题仍然存在.我做错了什么?

I have also tried clean and rebuild my project, but the problem persists. What am I doing wrong?

更新:

我的build.gradle

...
dependencies {
    compile project(':libraryListViewAnimations')
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:+'
    compile 'com.google.android.gms:play-services:7.0.0'
    compile files('libs/activation.jar')
    compile files('libs/additionnal.jar')
    compile files('libs/commons-net-3.1-sources.jar')
    compile files('libs/commons-net-3.1.jar')
    compile files('libs/mail.jar')
}

推荐答案

GooglePlayServicesClient 已过时,不再包含在 Google Play Services 7.x 库中.Google 建议改用 GoogleApiClient.

GooglePlayServicesClient is obsolete and no longer included in the Google Play Services 7.x library. Google recommends using the GoogleApiClient instead.

请参阅 Android 开发者文档中的访问 Google API:

See Accessing Google APIs in the Android developer docs:

注意:如果您有一个现有应用通过 GooglePlayServicesClient 的子类连接到 Google Play 服务,您应该尽快迁移到 GoogleApiClient."

这篇关于无法解析符号“GooglePlayServicesClient"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆