Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Places class is removed from android play services 9.2.0

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.

like image 772
Ravi Gadipudi Avatar asked Jun 28 '16 06:06

Ravi Gadipudi


3 Answers

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.

like image 32
Ravi Gadipudi Avatar answered Oct 14 '22 05:10

Ravi Gadipudi


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'
like image 98
Emerson Dallagnol Avatar answered Oct 14 '22 04:10

Emerson Dallagnol


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.*;
like image 2
reza rahmad Avatar answered Oct 14 '22 05:10

reza rahmad