选择谷歌播放服务API而不查找类

时间:2021-04-15 15:21:34

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.

我已经将play服务升级到最新的版本,目前的版本是9.2.0,我还想为谷歌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'

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.

有人能帮我解决这个问题吗?谢谢你!

1 个解决方案

#1


26  

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

基于@Selvin的评论,我找到了解决问题的方法。

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:

好像是在第九版。谷歌为场所播放服务API从播放服务位置移动到播放服务位置。因此,现在我对谷歌播放服务api有以下依赖关系:

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

#1


26  

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

基于@Selvin的评论,我找到了解决问题的方法。

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:

好像是在第九版。谷歌为场所播放服务API从播放服务位置移动到播放服务位置。因此,现在我对谷歌播放服务api有以下依赖关系:

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