【问题标题】:Selective Google Play Services API not finding classes选择性 Google Play 服务 API 未找到类
【发布时间】:2016-10-30 21:10:41
【问题描述】:

我已将播放服务更新到最新版本,目前为 9.2.0,我还想为 google play 服务使用选择性模块。

//    compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'

我遇到的问题是,现在的导入如下:

import com.google.android.gms.location.places.Place;

import com.google.android.gms.location.places.AutocompleteFilter;
import com.google.android.gms.location.places.AutocompletePrediction;
import com.google.android.gms.location.places.Place;
import com.google.android.gms.location.places.PlaceBuffer;
import com.google.android.gms.location.places.Places;

无法再解决,尽管在他们的文档中指出位置服务也应该提供地点功能。

有人可以帮我解决这个问题吗?谢谢。

【问题讨论】:

  • 您注意到我们也有play-services-places 吗?好像在 9.2.0 中他们拆分了它
  • 添加依赖后,您是否构建了项目?
  • @Selvin 我研究了这个页面的列表:developers.google.com/android/guides/…。我没注意到,我现在正在尝试。
  • @Tanis.7x 我做了 :)
  • @Selvin 你是对的,他们拆分了服务。我猜文档没有更新。谢谢。

标签: android import location google-play-services


【解决方案1】:

根据@Selvin 添加的评论,我设法找到了我的问题的解决方案。

似乎在 9.x.x 版本中,Google Play Services API for Places 已从 play-services-location 移至 play-services-places。 因此,现在我对 Google Play Services APIs 有以下依赖项:

//    compile 'com.google.android.gms:play-services:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-analytics:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'
compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-places:9.2.0'

【讨论】:

  • 您找到了解决方案,并为他人的利益发布了答案,谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多