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

编程入门 行业动态 更新时间:2024-10-24 14:24:33
无法使用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'

更多推荐

本文发布于:2023-08-07 19:29:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465612.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PlaceAutocompleteFragment   resolve

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!