react-native-mapbox-gl icon indicating copy to clipboard operation
react-native-mapbox-gl copied to clipboard

[ios] Random crash when pressing PointAnnotation

Open fvieira opened this issue 6 years ago • 3 comments
trafficstars

I have a map with a few clickable points of interest. In Android all is fine, on iOS, once in a while, when I press one of these points of interest, the app crashes with the following error:

libc++abi.dylib: terminating with uncaught exception of type NSException

I haven't been able to understand why it happens, just that it has to do with the PointAnnotation. I've been trying to fix/workaround this issue for two days now, with no success.

Things I've tried:

  • Clicking outside the PointAnnotations. It never crashes.
  • Replacing the children of my PointAnnotations to <Text>XXX</Text>. It still crashes sometimes when clicking.
  • Replacing the PointAnnotations with SymbolLayers. It doesn't crash anymore, but since I'm on version 6.1.3, this bug occurs: https://github.com/nitaliano/react-native-mapbox-gl/issues/1417. I couldn't work around it except by...
  • Upgrading to version 7.0.0-rc3 from this repo https://github.com/react-native-mapbox-gl/maps. Unfortunately that version is far from stable and badly documented yet. I got things mostly working on Android but then I went to iOS and had some very confusing bugs that made me give up on this approach.

In short, I'm stuck. I don't know how to get rid of this bug without replacing it with worse ones. Can anyone give me some pointers? Is there some more information I could give to help someone debug this crash?

Thanks in advance.

fvieira avatar Jul 17 '19 17:07 fvieira

Had the same issue with the following error message:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Annotation view's annotation property should not be nil.'

Possibly related to a bug in an previous version of mapbox-gl-native #9974. It went away after pulling the latest version from master, which esentially just upgraded the iOS SDK for Mapbox GL to 3.7.8.

arvidede avatar Jul 18 '19 13:07 arvidede

@arvidede Do you mean this repository's master? Because my code is on commit 429f540224c0be789e055bee4b7ed2943f0a5573 and after that commit are only 3 commits with nothing that could fix this problem...

fvieira avatar Jul 18 '19 16:07 fvieira

@fvieira Yes, this repo. Turns out the issue still remains in production, but not in dev. I'll keep you posted if I find anything.

arvidede avatar Jul 19 '19 08:07 arvidede