Do I Have to Replace Android LocationClient with GoogleApiClient?

771 views Asked by At

I made the bad move of updating my Android SDKs and now my app is all jammed up. Android Studio is not showing me any errors in my code, but when I compile I get several build errors that say "cannot find symbol class LocationClient"

I've read several threads about this and they seem to point to the idea of using GoogleApiClient in place of LocationClient. I really would prefer not to have to make this change right now. Is there any other way the remedy this?

2

There are 2 answers

0
wkarl On

You will have to use GoogleApiClient, I had the same problem. It is pretty straight forward though, works very similar.

0
matt.writes.code On

Using GoogleApiClient in place of LocationClient is the long-term solution.

However, you can temporarily avoid making changes by using a Google Play Services earlier than 6.5.87. LocationClient class was removed in 6.5.87. You can do this by specifying which version of Google Play Services you would like to use in your build.gradle dependencies (assuming you're using Android Studio):

dependencies {
    provided 'com.google.android.gms:play-services:6.1.71'
}

or

dependencies {
    provided 'com.google.android.gms:play-services:5.+'
}

This second one will lock you into the most recent version of google play services 5.