Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android class 'GeofencingClient' doesn't exist?

I'm attempting to follow the Android geofencing guide, but I immedietely get stuck when I try to declare a GeofencingClient variable:

Cannot resolve symbol GeofencingClient

Normally I would be able to just press Alt+Enter and select "Import class", but this option isn't available here:

No import class option

Does the GeofencingClient class exist anymore? Do I need to install some third party library?

like image 867
SimpleJ Avatar asked Dec 18 '22 20:12

SimpleJ


1 Answers

GeofencingClient is part of Google Play Services. You need to add the following dependency to the build.gradle file of the module, then you will be able to import the class in your code:

dependencies {
    // ...
    implementation 'com.google.android.gms:play-services-location:17.0.0'
   //...
}
like image 116
Bö macht Blau Avatar answered Dec 30 '22 01:12

Bö macht Blau