0

i want to import these libraries but they are giving me an error which says "cannot resolve symbol 'android'". I don't know why i can't import them.

import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationServices;

i want to use GPS/location services in my app and i have the latest android studio version. Does anyone know why am i getting this error.

Thanks.

  • 3
    Possible duplicate of [Android The import com.google cannot be resolved](http://stackoverflow.com/questions/17164736/android-the-import-com-google-cannot-be-resolved) – Tristan Oct 20 '15 at 17:41

1 Answers1

1

It sounds like you missed the first step of setting up Google Play Services, which is adding the dependencies to your build.gradle.

For location services, you need the following:

dependencies {
    compile 'com.google.android.gms:play-services-maps:8.1.0'
}
Bryan Herbst
  • 66,602
  • 10
  • 133
  • 120
  • Yeah, I didn't set up that Google Play services by adding the dependencies in build.gradle file. Now my code is working fine. Thanks. – Manmeet Khurana Oct 22 '15 at 00:12