不能导入com.google.android.gms.location.LocationServices [英] Can't Import com.google.android.gms.location.LocationServices

查看:1340
本文介绍了不能导入com.google.android.gms.location.LocationServices的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图得到最准确的位置。

I'm trying to get the most accurate location.

到现在我心中已经成功地使用LocationClient在谷歌文档:
http://developer.android.com/training/location/retrieve-current.html

till now I'v used successfully LocationClient as in Google docs: http://developer.android.com/training/location/retrieve-current.html

但现在我发现,这个类是旧的:
http://developer.android.com/reference/com/google/android/gms/location/package-summary.html

But now I have discovered that this class is old: http://developer.android.com/reference/com/google/android/gms/location/package-summary.html

该类德precated。使用LocationServices。

然而,即使在此网站LocationServices的例子:
<一href=\"http://stackoverflow.com/questions/24611977/android-locationclient-class-is-de$p$pcated-but-used-in-documentation\">Android LocationClient类去precated但在文档中使用

However in the examples of LocationServices even in this site: Android LocationClient class is deprecated but used in documentation

这似乎我们应该使用导入:com.google.android.gms.location.LocationServices
不过,我不能导入这个类。

It seem we should use an import: com.google.android.gms.location.LocationServices However I can't import this class..

任何想法?

编辑:

我在本页面发现:
h2ttps://github.com/M66B/XPrivacy/issues/1774

I have found in this page: h2ttps://github.com/M66B/XPrivacy/issues/1774

看似类似的问题,一个猜测:
似乎是发挥服务5.0的一部分。的结果
我不知道如果是这样的话 - 有没有人尝试过​​呢?

with seemingly similar problem, a speculation that: "Seems to be part of Play services 5.0."
I wonder if that is the case -- has anybody tried this ?

推荐答案

请确保你有你的依赖的gradle以下项目:

Make sure you have the following item in your gradle dependency:

dependencies {
    compile 'com.google.android.gms:play-services-location:7.+'
}

这篇关于不能导入com.google.android.gms.location.LocationServices的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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