Places class is removed from android play services 9.2.0

杀马特。学长 韩版系。学妹 提交于 2019-12-17 11:22:35

问题


Today, I updated to google play services to 9.2.0. I got an error

com.google.android.gms.location.places.Places

not found. that broke below two lines

.addApi(Places.GEO_DATA_API)
.addApi(Places.PLACE_DETECTION_API)

any leads on where i can find GEO_DATA_API, PLACE_DETECTION_API

Thanks in advance.


回答1:


In 9.0.2, the 'places' library was inside 'location' library. In 9.2, you need to add 'places' library as dependency:

implementation 'com.google.android.gms:play-services-places:9.2.0'



回答2:


The document is not updated as of 28th June. I suggest downgrading play services library to 9.0.2. (docs last updated on 23th June).

Edited: as Emerson suggested,

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

add that for places library to your Gradle. It's not updated in official documentation.




回答3:


for play service 9.2.0 places import has changed from

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

to

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

or you need all places folder

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


来源:https://stackoverflow.com/questions/38068786/places-class-is-removed-from-android-play-services-9-2-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!