6

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

我相信这可能是 Google Play 服务设置的问题
我已按照此处的说明进行操作http://developer.android.com/google/play-services/setup.html但我现在收到错误消息。

这可能与我之前通过 Eclipse 中的 SDK 管理器安装 Google Play Services 的事实有关吗?

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

4

3 回答 3

7

LocationClient几个月前已从 Play Services SDK 中删除。您现在使用GoogleApiClientLocationServices.APIFusedLocationProviderApi来访问 Play Services 中的融合位置提供程序。这个示例项目演示了如何从这个新的 API 获取位置修复,它的使用也在这篇博文中介绍。

于 2015-03-12T10:52:53.250 回答
6

小技巧

google play services旧版本添加到您的build.gradle

compile 'com.google.android.gms:play-services:5.0.89'

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

于 2015-03-12T10:52:23.510 回答
3

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

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

在这里您可以找到包含一些 Google Play 服务 API 的列表(滚动到表 1)

PS:还不能添加评论:(

于 2016-02-03T09:56:12.077 回答