选择性Google Play服务API找不到类 [英] Selective Google Play Services API not finding classes

查看:181
本文介绍了选择性Google Play服务API找不到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将Play服务更新到最新版本,该版本目前位于 9.2.0 ,我也希望为Google Play服务使用选择性模块。

  //编译'com.google.android.gms:play-services:9.2.0'
编译'com.google.android.gms: play-services-maps:9.2.0'
compile'c​​om.google.android.gms:play-services-analytics:9.2.0'
compile'c​​om.google.android.gms:play- services-gcm:9.2.0'
compile'c​​om.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;

无法解析,尽管在文档中指出位置服务应提供位置功能。

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

解决方案

基于@Selvin添加的评论,我设法为我的问题找到解决方案。



看起来版本 9.xx ,Google Play Services API 已从 play-services-location 转换为 play-services-places
因此,现在我对 Google Play服务API有以下依赖关系:

  // compile'c​​om.google.android.gms:play-services:9.2.0'
compile'c​​om.google.android.gms:play-services-maps:9.2.0'
编译'com.google.android.gms:play-services-analytics:9.2.0'
compile'c​​om.google.android.gms:play-services-gcm:9.2.0'
compile' com.google.android.gms:play-services-location:9.2.0'
compile'c​​om.google.android.gms:play-services-places:9.2.0'


I've updated play services to the latest version, which currently is at 9.2.0 and I also want to use selective modules for the google play services.

//    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'

The issue I'm having, is that now the imports like:

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;

Cannot be resolved anymore, although in their documentation it is stated that location services should provide Places features also.

Can someone help me with this Issue? Thank you.

解决方案

Based on the comment added by @Selvin, I managed to find the solution for my issue.

It seems that on version 9.x.x, Google Play Services API for Places was moved from play-services-location into play-services-places. Thus, now I'm having the following dependencies for 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'

这篇关于选择性Google Play服务API找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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