4

I am making an android application that uses Google maps. I had the code working perfectly until I upgraded Eclipse from Juno to Luna. I also updated some revisions of the SDK that were published. After this, a lot bunch of errors appeared in my code (whose was working nicely before, maybe from the Eclipse update). After repairing the errors and re-importing the libraries, one error remains "The import com.google.android.gms.location.LocationClient cannot be resolved". After some searches online I found that the "google-play-services_lib" is needed to be imported again and by the error log it isn't found. I checked in the buildpath and properties of my project and the library and folder were present. I deleted them and re-imported again just to be sure, but the problem persists.

Build Path

Library view

Project Folder

What I don' understand is how it is possible that the same code worked and now it doesn't. I have even downloaded the Android Studio, downloaded the Google Play Services from there to a new location, imported it and still the same. Any help would be really appreciated.

g_brahimaj
  • 197
  • 7
  • 21
  • Check the link, it may help http://stackoverflow.com/questions/27372638/android-play-services- 6-5-locationclient-is-missing – sunjoy Mar 15 '15 at 09:58
  • That guy asked it 4 days before me :). Anyway it is a solved problem thanks to @purplemind – g_brahimaj Mar 16 '15 at 12:36

2 Answers2

2

To be sure did you check box Is Library: at workspace right click on google-play-services_lib -> Properties -> Android?

purplemind
  • 71
  • 3
  • 1
    Is there class LocationClient within google-play-services_lib com.google.android.gms.location package? If there is not, check this [link](http://stackoverflow.com/questions/24611977/android-locationclient-class-is-deprecated-but-used-in-documentation) – purplemind Dec 13 '14 at 14:29
  • The class wasn't present. I followed the indications in the link and the error has disappeared. Now I cannot open the map because it doesn't recognize the api key (I'm on a different PC), but I believe it will work. – g_brahimaj Dec 13 '14 at 18:57
  • Window->Preferences->Android->Build: check if following settings "Default debug keystore", "MD5", "SHA1" are correct. Or set API key again via google console following [official docs](https://developers.google.com/maps/documentation/android/start#installing_the_google_maps_android_v2_api) – purplemind Dec 13 '14 at 19:52
0

In Project Properties->JavaBuildPath section-> order and Export section. Make sure checkbox is checked or not for googlePlayService. And then clean your project and re-build.

Ganesh Katikar
  • 2,620
  • 1
  • 26
  • 28
  • It was unchecked. I checked it, clean-build and still the same. – g_brahimaj Dec 13 '14 at 14:05
  • You will need the Google Play Services SDK configured within Eclipse and import google play services as library will dismiss this error. Make sure Google Play Services SDK is configured within your Eclipse. – Ganesh Katikar Dec 13 '14 at 14:08
  • What do you mean with "Google Play Services SDK configured within Eclipse"? The project is imported through Eclipse, imported as Library. Anything else? – g_brahimaj Dec 13 '14 at 14:10
  • Try to import as library. – Ganesh Katikar Dec 13 '14 at 14:12
  • 1
    If you check the screenshots it is already imported. I have also imported the google-play-service_lib.jar as external source checked in Order and Export and still nothing. – g_brahimaj Dec 13 '14 at 14:17