Cannot resolve symbol 'LocationClient' in Android Studio
Asked Answered
N

3

6

I'm getting this error developing an application in Android Studio that I would like to use location services in.
I know this question has been asked before but I beleive the previous was with an app developed in Eclipse.

I beleive this may be an issue with the setup of Google Play Services
I have followed the instructions here http://developer.android.com/google/play-services/setup.html but I am now getting the error.

Could it be something to do with the fact that I previously installed Google Play Services through the SDK manager in eclipse before?

Any help would be appreciated, thanks

Necropsy answered 12/3, 2015 at 10:47 Comment(0)
S
7

LocationClient was removed from the Play Services SDK a few months ago. You now use GoogleApiClient, LocationServices.API, and FusedLocationProviderApi to access the fused location provider in Play Services. This sample project demonstrates how to get a location fix from this new API, and its use is also covered in this blog post.

Seem answered 12/3, 2015 at 10:52 Comment(0)
R
6

Small trick

add google play services older version in your build.gradle

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

I know this is not good solution. But it could solve your issue.

Remmer answered 12/3, 2015 at 10:52 Comment(0)
A
3

Or if you just need the location service so use

compile 'com.google.android.gms:play-services-location:x.x.x'

Here you can find a list with some Google Play services API (scroll to Table 1)

P.S.: Can't add comments yet :(

Adonis answered 3/2, 2016 at 9:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.