Android Studio GeoDataClient cannot be resolved

Yago Dórea picture Yago Dórea · Aug 20, 2017 · Viewed 11.3k times · Source

I haven't seen this problem anywhere on the internet, also it doesn't seem the library is deprecated, but I just can't add the import:

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

My Android SDK is up to date.

Does anyone know how to use it? Or rather, another way to get my current location on GPS?

Thanks a lot.

Answer

Xianwei picture Xianwei · Oct 28, 2017

just add:

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

and

repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
}

because GeoDataClient was added in 11.2.0 you can check this official document