ClusterKit icon indicating copy to clipboard operation
ClusterKit copied to clipboard

mapView(_:didTap:) crashes randomly

Open Rakesh-iOS opened this issue 4 years ago • 1 comments

Hi I am getting this crash randomly on Production live app.

Here is the code snippet: func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {

    if marker.responds(to: #selector(getter: GMSMarker.cluster)) {
               if let cluster = marker.cluster, cluster.count > 1 { **// crash strack trace indicating this line where crash happen**
                   OperationQueue.main.addOperation {
                       let cameraUpdate = GMSCameraUpdate.fit(marker.cluster!)
                       mapView.animate(with: cameraUpdate)
                   }
                   return true
               }
    }

}

ClusterKit version: 0.5.0 GoogleMapExtension: "GMSMapView+ClusterKit.h"

Screenshot 2020-10-13 at 11 04 52 AM

This is Firebase crash report :

Screenshot 2020-10-13 at 10 23 41 AM

Please help me out. It would be highly appreciated as I'm getting this crash from last 4 - 5 releases.

Rakesh-iOS avatar Oct 13 '20 05:10 Rakesh-iOS

when you remove marks from map - remove them from the map as well (not only from cluster manager) the cluster manager is not synced with what you see on the map other wise.

alexvaiman avatar Dec 10 '20 23:12 alexvaiman