Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio GeoDataClient cannot be resolved

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.

like image 405
Yago Dórea Avatar asked Aug 20 '17 03:08

Yago Dórea


3 Answers

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

like image 140
Xianwei Avatar answered Oct 08 '22 04:10

Xianwei


Try to add

```gradle

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

``` in build.gradle, then you may need add

```gradle

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

}

```

finally, Build -> rebuild project.

like image 38
jiar wang Avatar answered Oct 08 '22 04:10

jiar wang


Adding just this one dependency to apps build.gradle

compile 'com.google.android.gms:play-services:11.8.0'

and below code to project's build.gradle should work.

allprojects {
    repositories {
        google()
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}
like image 30
Shree Avatar answered Oct 08 '22 05:10

Shree