Mapsui: Problem with crash on android LayerCollection.CopyTo
Hello
We’ve recently updated app to run Mapsui forms. Had my own custom renderes before. After this update we got some crash. (I have not seen it myself, but I see it in app center)
Error: LayerCollection.CopyTo (Mapsui.Layers.ILayer[] array, System.Int32 arrayIndex) System.ArgumentException: The number of elements in the collection is greater than the available space from index to the end of the destination array.
Stack trace:
ConcurrentQueue`1[T].CopyTo (T[] array, System.Int32 index)
LayerCollection.CopyTo (Mapsui.Layers.ILayer[] array, System.Int32 arrayIndex)
System.Collections.Generic.List`1[T]..ctor (System.Collections.Generic.IEnumerable`1[T] collection) [0x0003b] in <19853c43ab794d18ab1a33ecb65b3c4d>:0
Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source)
Map.RefreshData (Mapsui.Geometries.BoundingBox extent, System.Double resolution, System.Boolean majorChange)
MapControl.RefreshData ()
MapControl.Refresh ()
MapControl.MapPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e)
Map.OnPropertyChanged (System.Object sender, System.String propertyName)
Map.OnPropertyChanged (System.String name)
Map.LayersLayerRemoved (Mapsui.Layers.ILayer layer)
(wrapper delegate-invoke) <Module>.invoke_void_ILayer(Mapsui.Layers.ILayer)
LayerCollection.OnLayerRemoved (Mapsui.Layers.ILayer layer)
LayerCollection.Remove (Mapsui.Layers.ILayer layer)
MapView.RemoveLayers ()
MapView.HandlerLayerChanged (Mapsui.Layers.ILayer layer)
(wrapper delegate-invoke) <Module>.invoke_void_ILayer(Mapsui.Layers.ILayer)
LayerCollection.OnLayerAdded (Mapsui.Layers.ILayer layer)
LayerCollection.Add (Mapsui.Layers.ILayer layer)
MapSuiView2+<>c__DisplayClass103_1.<AddMarker>b__1 ()
Thread+RunnableImplementor.Run ()
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)
Have no clue how to generate this crash. Why it appears
Have anyone seen this before? And maybe know a fix for it
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 27 (20 by maintainers)
I consider this fixed.
We know it’s a problem. We have to think of a real solution for the problem.