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

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

问题描述

我试图将项目从Eclipse的移植到Android的工作室,该项目可建立在Eclipse中,并成功导入到Android的工作室,不过,我得到无法解析符号GooglePlayServicesClient在Android的工作室错误。

我跟着官方教程,在Android的工作室导入谷歌Play服务,以及用在其他包 com.google.android.gms.common.ConnectionResult 我的项目没有同样的问题。只有 GooglePlayServicesClient 无法得到解决。

我自己也尝试干净,重建我的项目,但问题仍然存在。我究竟做错了什么?

更新:

我的 build.gradle

  ...
依赖{
    编制项目(:libraryListViewAnimations)
    编译com.android.support:support-v4:21.0.3
    编译com.android.support:appcompat-v7:21.0.3
    编译com.google.android.gms:播放服务:+
    编译com.google.android.gms:播放服务:7.0.0
    编译文件(库/的activati​​on.jar)
    编译文件(库/ additionnal.jar)
    编译文件(库/公网-3.1-sources.jar)
    编译文件(库/公网-3.1.jar)
    编译文件(库/的mail.jar)
}
 

解决方案

GooglePlayServicesClient已过时,不再包含在谷歌播放服务7.x的图书馆。谷歌建议使用<一个href="https://developer.android.com/reference/com/google/android/gms/common/api/GoogleApiClient.html">GoogleApiClient代替。

请参阅访问谷歌的API 的在Android开发者文档:

注意:如果你有一个现有的应用程序,连接到谷歌播放服务,GooglePlayServicesClient的子类,则应该迁移到尽快GoogleApiClient。

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.

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?

Update:

My 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 is obsolete and no longer included in the Google Play Services 7.x library. Google recommends using the GoogleApiClient instead.

See Accessing Google APIs in the Android developer docs:

"Note: If you have an existing app that connects to Google Play services with a subclass of GooglePlayServicesClient, you should migrate to GoogleApiClient as soon as possible."

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

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