Can not resolve symbol 'GeofencingClient'

1

I started working in the Android field and I worked in an app that uses geofencing, using the google documentation I found a class that I can not use " GeofencingClient " and I do not know which dependency requires, research on the Internet but I can not find it, attach a piece of code.

import android.support.v4.app.FragmentActivity;
import android.os.Bundle;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;


public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {

    private GoogleMap mMap;

    private GeofencingClient mGeofencingClient;


}
    
asked by Sara 23.10.2018 в 16:53
source

1 answer

0

You simply can not access the class since you have not added the import suitable for class GeofencingClient :

 private GeofencingClient mGeofencingClient;

you must add the import:

import com.google.android.gms.location.GeofencingClient;

and obviously in the dependencies of your file build.grade define play-services-location :

dependencies {
    ...
    ...
    ...
    implementation 'com.google.android.gms:play-services-location:16.0.0'

}
    
answered by 23.10.2018 / 17:04
source