androidandroid-geofence

Android Geofencingclient ApiException 1004:


I have been trying to implement Geofencing for an android app, and right now after initializing the GeoFenceRequest as per Google's Documentation and then adding it with the GeoFencingClient

geofencingClient.addGeofences(geoFenceRequest, geofencePendingIntent).addOnSuccessListener {
        Log.d(TAG, "GeoFence Added")
    }.addOnFailureListener {
        Log.d(TAG, "GeoFence Failed to Add")
    }

i get this error

com.google.android.gms.common.api.ApiException: 1004: 

and i cannot find any documentation describing anything related to it at all


Solution

  • found the solution apparently 1004 is the app lacks permissions from the device, i was missing the background location permission for android 10. this is the documentation for the status codes: https://developers.google.com/android/reference/com/google/android/gms/location/GeofenceStatusCodes