5

I have a high priority project under development.
I am trying to insert geo location into db so I found a service online and unfortunately LocationRequest and LocationServices.API are not resolved.
I am using the dependency 'com.google.android.gms:play-services-maps:10.2.0'

enter image description here

I tried adding the imports

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

You can find the code I used at this link

Community
  • 1
  • 1
Krishna Avadhanam
  • 98
  • 1
  • 2
  • 10

3 Answers3

19

Seems like you need to compile the play-services-location package.

Put these into the build.gradle

ext {
    playServicesVersion = '10.2.0' // update accordingly 
}

dependencies {
    ...
    compile "com.google.android.gms:play-services-maps:${playServicesVersion}"
    compile "com.google.android.gms:play-services-location:${playServicesVersion}"
}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
2

Try this implementation 'com.google.android.gms:play-services-location:15.0.1' in your app.gradle, and update the version regularly.

Jiraiya
  • 76
  • 1
  • 4
0

Try this implementation 'com.google.android.gms:play-services:12.0.1' worked for me

Venkatesh
  • 1,034
  • 13
  • 25