transistorsoft / flutter_background_geolocation

Sophisticated, battery-conscious background-geolocation & geofencing with motion-detection
https://www.transistorsoft.com/shop/products/flutter-background-geolocation
Other
650 stars 241 forks source link

IOS crash on addGeofence -> NSInvalidArgumentException #1337

Closed lloydelvt closed 2 months ago

lloydelvt commented 3 months ago

Your Environment

Expected Behavior

Geofences Should be added, and if they are not added the code should at least catch the error.

Actual Behavior

Instead the IOS application crashes

Steps to Reproduce

  1. Create a list of geofences then add geofences

Context

await bg.BackgroundGeolocation.addGeofences(newGeofences).then((bool success) {
      print('[addGeofence] success with adding new geofences');
      AppData.log.add('[addGeofence] success with adding new geofences');
    }).catchError((error) {
      print('[addGeofence] FAILURE with adding new geofences');
      AppData.log.add('[addGeofence] FAILURE with adding new geofences');
});

Debug logs

Logs ``` *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TSGeofence initWithIdentifier:radius:latitude:longitude:notifyOnEntry:notifyOnExit:notifyOnDwell:loiteringDelay:extras:vertices:]: unrecognized selector sent to instance 0x303408b40' *** First throw call stack: (0x18e9a0f20 0x186852018 0x18eaaa480 0x18e93dfb4 0x18e93d8d0 0x101807c94 0x101807058 0x1018034f0 0x1078361e4 0x1072a5794 0x104634b98 0x1046367bc 0x104646d58 0x10464690c 0x18e973710 0x18e970914 0x18e96fcd8 0x1d38201a8 0x190fa890c 0x19105c9d0 0x100ff3320 0x1b2021e4c) libc++abi: terminating due to uncaught exception of type NSException ```
lloydelvt commented 3 months ago

We thought this was an issue related to adding the geofences one at a time and saw the same issue there.

christocracy commented 3 months ago

addGeofences(newGeofences)

It would help a lot if I could see the contents of this object newGeofences

lloydelvt commented 3 months ago
[log] [
[Geofence identifier: 1234, radius: 60.00000192, 27.4610725 / -80.303821, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"], 
[Geofence identifier: 1287, radius: 30.00000096, 27.4125907 / -80.3903845, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"], 
[Geofence identifier: 1248, radius: 60.95702724779031, 28.0822586 / -80.6635642, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"],
 [Geofence identifier: 1249, radius: 60.95702724779031, 28.1084238 / -80.6475169, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"],
 [Geofence identifier: 1313, radius: 60.95702724779031, 39.74959609999999 / -104.9508519, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"],
 [Geofence identifier: 1314, radius: 1908.000061056, 37.335928 / -121.9994844, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"],
 [Geofence identifier: 1235, radius: 58.000001856000004, 27.4486511 / -80.32413179999999, notifyOnEntry:true, notifyOnExit:true, notifyOnDwell: null, vertices: null"]
]
christocracy commented 3 months ago

Show me the code where you're creating these Geofence instances. I want to see the data you're feeding them with.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.