无法解析符号' LocationClient'在Android Studio中

时间:2015-03-12 10:47:47

标签: android android-studio google-play-services location-client location-services

我在Android Studio中开发应用程序时遇到此错误,我想使用位置服务。
我知道之前已经问过这个问题,但我相信之前使用的应用程序是开发的日食。

我相信这可能是Google Play服务设置的问题。我已遵循此处http://developer.android.com/google/play-services/setup.html的说明,但我现在收到错误。

这可能与我之前在eclipse中通过SDK管理器安装Google Play服务这一事实有关吗?

任何帮助都将不胜感激,谢谢

3 个答案:

答案 0 :(得分:6)

小技巧

google play services

中添加build.gradle旧版本
compile 'com.google.android.gms:play-services:5.0.89'

我知道这不是一个好的解决方案。但它可以解决你的问题。

答案 1 :(得分:6)

几个月前,

LocationClient已从Play服务SDK中删除。您现在可以使用GoogleApiClientLocationServices.APIFusedLocationProviderApi访问Play服务中的融合位置提供程序。 This sample project演示了如何从这个新API获取位置修复程序,this blog post中也介绍了它的用法。

答案 2 :(得分:3)

或者,如果您只需要位置服务,请使用

compile 'com.google.android.gms:play-services-location:x.x.x'

Here您可以找到包含某些Google Play服务API的列表(滚动到表1)

P.S。:还不能添加评论:(