Android Studio GeoDataClient cannot be resolved

I have not seen this problem anywhere on the Internet, nor does the library seem to be out of date, but I just cannot add the import:

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

My Android SDK is updated.

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

Thank you very much.

+5
source share
4 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 white paper

+5
source

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 to add

`` `gradle

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

}

`` ``

finally, Build -> rebuild project , there is a simple demo using the Google Map API & Google Direction API etc. in my github . Hope this helps you.

+3
source

this link can help you. This applies to using the Geo location in the Android app https://www.toptal.com/android/android-developers-guide-to-google-location-services-api

0
source

Adding only this dependency to apps build.gradle

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

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

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

Source: https://habr.com/ru/post/1271022/


All Articles