无法使用10.2.0解析PlaceAutocompleteFragment(Cannot resolve PlaceAutocompleteFragment with 10.2.0)

我正在尝试将一个PlaceAutocompleteFragment添加到我的活动中,这是所有我正在使用的导入:

import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.Place; import com.google.android.gms.location.places.ui.PlaceAutocompleteFragment; import com.google.android.gms.location.places.ui.PlaceSelectionListener;

我正在学习本教程 ,所以最初我的应用gradle compile 'com.google.android.gms:play-services-location:8.4.0' ,这个版本的所有导入都是完美的,但我想使用更新的版本。

问题是,使用compile 'com.google.android.gms:play-services-location:10.2.0'任何导入都不起作用,并且它无法解析任何这些类。 9.4.0相同。

我有干净的,重建和重新同步项目,但错误仍然存​​在。 什么可能是错的?

我正在使用Android Studio

android { compileSdkVersion 25 buildToolsVersion '25.0.2'

I'm trying to add a PlaceAutocompleteFragment to my activity, this are all the imports I'm using:

import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.Place; import com.google.android.gms.location.places.ui.PlaceAutocompleteFragment; import com.google.android.gms.location.places.ui.PlaceSelectionListener;

I was following this tutorial, so initially my app gradle had compile 'com.google.android.gms:play-services-location:8.4.0' with this version all the imports above work perfect, but I want to use a newer version.

The problem is that with compile 'com.google.android.gms:play-services-location:10.2.0' none of the imports work and it cannot resolve any of those classes. Same for 9.4.0.

I have clean, rebuild and re sync the project but the error persists. What could be wrong?

I'm using Android Studio with

android { compileSdkVersion 25 buildToolsVersion '25.0.2'

最满意答案

自从教程写完以后,Places已经分成了自己的库

compile 'com.google.android.gms:play-services-places:10.2.4'

Places has split out into its own library since the tutorial was written

Add

compile 'com.google.android.gms:play-services-places:10.2.4'无法使用10.2.0解析PlaceAutocompleteFragment(Cannot resolve PlaceAutocompleteFragment with 10.2.0)

我正在尝试将一个PlaceAutocompleteFragment添加到我的活动中,这是所有我正在使用的导入:

import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.Place; import com.google.android.gms.location.places.ui.PlaceAutocompleteFragment; import com.google.android.gms.location.places.ui.PlaceSelectionListener;

我正在学习本教程 ,所以最初我的应用gradle compile 'com.google.android.gms:play-services-location:8.4.0' ,这个版本的所有导入都是完美的,但我想使用更新的版本。

问题是,使用compile 'com.google.android.gms:play-services-location:10.2.0'任何导入都不起作用,并且它无法解析任何这些类。 9.4.0相同。

我有干净的,重建和重新同步项目,但错误仍然存​​在。 什么可能是错的?

我正在使用Android Studio

android { compileSdkVersion 25 buildToolsVersion '25.0.2'

I'm trying to add a PlaceAutocompleteFragment to my activity, this are all the imports I'm using:

import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.Place; import com.google.android.gms.location.places.ui.PlaceAutocompleteFragment; import com.google.android.gms.location.places.ui.PlaceSelectionListener;

I was following this tutorial, so initially my app gradle had compile 'com.google.android.gms:play-services-location:8.4.0' with this version all the imports above work perfect, but I want to use a newer version.

The problem is that with compile 'com.google.android.gms:play-services-location:10.2.0' none of the imports work and it cannot resolve any of those classes. Same for 9.4.0.

I have clean, rebuild and re sync the project but the error persists. What could be wrong?

I'm using Android Studio with

android { compileSdkVersion 25 buildToolsVersion '25.0.2'

最满意答案

自从教程写完以后,Places已经分成了自己的库

compile 'com.google.android.gms:play-services-places:10.2.4'

Places has split out into its own library since the tutorial was written

Add

compile 'com.google.android.gms:play-services-places:10.2.4'