2

We're seeing lots of crashes recorded by App Center that seem to occur pretty far down in the Xamarin.iOS stack. We'd like to discover if it's something we are doing incorrectly. Details from App Center are below. Are there any types of UI work that seem more likely than others to cause these crashes?

Xamarin_iOS_UIKit_UIView_RemoveFromSuperview

SIGABRT: Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.

Main thread backtrace: enter image description here

kiroc
  • 86
  • 5
  • Views with ItemTemplates - that's where I'd start looking. Its not safe to add/remove items from an ObservableCollection that is Bound to a view, except from the MainThread. Only seems to be a problem on iOS. Prep any new elements, then wrap `Device.BeginInvokeOnMainThread` around the final step that changes the collection. Be aware that BeginInvoke *queues* what is inside it, so if you need any code to run AFTER changing the collection, that must also be inside the BeginInvoke (perhaps via calling/invoking an Action inside the BeginInvoke). – ToolmakerSteve Jun 08 '22 at 18:08

0 Answers0