I am getting an error in the onAddGeofencesResult(int statusCode, String[] geofenceRequestIds)
callback with statusCode = 1000
.
I have my GP
In Android 9.0: I read MinistryOfChaps answer and I tried do this for one hour but it has not worked to me. So I turned off my app, turned off 'Improve Location Accuracy', turned off Scanning > wi-fi scanning and bluetooth scannig, and I turned off my User location too. After this, I turn on all these options and my geofence finally is working
I was getting the statusCode 1000 when i was trying to run this app on the emulator. The thing which fixed this was to go in Settings-> locations and access-> Check the enable wifi and gps option on the emulator and it will fix it
This error occurs also when location service is not enabled. You need to set it enabled.
You actually gave the answer in your question: Geofence service is not available now. Typically this is because the user turned off location access in settings > location access.
I had this same issue, and just going to settings --> location and making sure I select the mode for high accuracy fixed this issue.
PS Device only mode is not good enough, it needs to be High accuracy mode.
Hope this helps.
I did silly mistake:
Error occurred because Device does not have Permission for GPS (Location service).
More details on Geofencing API here.
Screen shots for reference:
Hope this will make you clear.