0

I have crashes in Crashlytics tool and I don't know how to fix them. Screenshot of how it looks in Crashlytics:

Crashlytics screenshot

It seems that problem is in Mapbox source codes. Codes from my project:

DispatchQueue.global(qos: .userInitiated).async {
   let annotsToRemove = self?.mapView.annotations?.filter({ $0 is MapDangerAnnotation })
   let annotsToAdd = dangers.map { MapDangerAnnotation(danger: $0) }

84 line is middle line with filter function. I don't know what could be wrong. Do you know where could be problem? One thing I could think of is that I am not working in main thread but it's just working in most cases and crashing just in few cases.

Thanks, for help

Libor Zapletal
  • 13,752
  • 20
  • 95
  • 182
  • Could you share which version of the Mapbox Maps SDK for iOS you are using? – jmkiley May 22 '18 at 18:54
  • Also, do you still see these crashes if you move the filter to the main thread? UI changes such as adding and removing annotations should occur on the main thread. – jmkiley May 22 '18 at 19:15
  • I was using 3.7.8 Mapbox version. Today I updated this version to newest 4.0.1 so I am looking forward to if this help or not. Problem is that I can't simulate this problem but I have it only from real users (not all, just part of them, probably in some situation, iOS 9 - 11) in Crashlytics. That's why It would be hard to test if moving this function to main thread helps but It would be the best thing to do. – Libor Zapletal May 22 '18 at 20:18

0 Answers0