Closed angel1st closed 3 years ago
The call to start the geofence service goes even before the Location permission is asked by the app. You could manually give permission and then restart the app to solve the above issue.
I have exactly the same issue and used the package simple_permissions to be sure that all permissions were set to authorized before clicking on register. Indeed, they are all correct so it does not seem to be the real problem ... Anyone succeeded to make FlutterGeofencing works ?
I hope s.o. can help because this is a very promising work ! Good blog post too :)
Also, make sure the location accuracy is set to high. Enable GPS+mobile data+WiFi accuracy(highest possible) in location settings.
I have the exact same problem on an Android 9 emulator. The problem persists even though the app has Location permission, Google Location Accuracy is activated and WiFi + Location + Mobile Data is turned on.
did anyone resolve this issue? I can´t continue with my project, I tested almost all the Geofences APIs, but Android throw this PlatformException all the time.
E/GeofencingPlugin: Failed to add geofence: com.google.android.gms.common.api.ApiException: 1000:
E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(com.google.android.gms.common.api.ApiException: 1000: , null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
That error 1000 is a geofencing error from Android. I was able to fix it. I had to allow "Improve Location Accuracy" in Android settings so it could use WiFi, mobile networks etc. to improve location accuracy. It appearsr geofencing doesn't work without that enabled. Here are some related links:
https://androidforums.com/threads/error-adding-geofence-on-android-8.1289302/
did anyone resolve this issue? I can´t continue with my project, I tested almost all the Geofences APIs, but Android throw this PlatformException all the time.
E/GeofencingPlugin: Failed to add geofence: com.google.android.gms.common.api.ApiException: 1000: E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(com.google.android.gms.common.api.ApiException: 1000: , null, null) #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
This happens when you don't turn on the GPS
Yeah, this sounds like a permissions issue. Are you sure your permissions are all set correctly and that the GPS is enabled?
I have simply cloned the repo, built and started the example app. I have got the following error, once I tapped on Register button: