SIGABRT: Failed to marshal the Objective-C object 0x11a2bce80 (type: Xamarin_Forms_Platform_iOS_HeaderWrapperView)

Sant, Mehul 1 Reputation point
2021-09-22T04:29:45.557+00:00

Stack trace

Runtime.MissingCtor (System.IntPtr ptr, System.IntPtr klass, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution resolution) /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/Runtime.cs:1092
Runtime.ConstructNSObject[T] (System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution)
Runtime.GetNSObject[T] (System.IntPtr ptr)
UIView.get_Superview () /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:4802
VisualElementRenderer1[TElement].UpdateParentPageAccessibilityElements () VisualElementRenderer1[TElement].OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e)
BoxRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\BoxRenderer.cs:70
(wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
BindableObject.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:266
Element.OnPropertyChanged (System.String propertyName) D:\a\1\s\Xamarin.Forms.Core\Element.cs:362
BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:510
BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446
BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:160
BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) D:\a\1\s\Xamarin.Forms.Core\BindingExpression.cs:75
Binding.Apply (System.Object context, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\Binding.cs:143
BindableObject.ApplyBindings (System.Boolean skipBindingContext, System.Boolean fromBindingContextChanged) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:530
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:246
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:479
Element.<OnBindingContextChanged>b__83_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:310
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList1[T] children, System.Action2[T1,T2] setChildBindingContext)
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
VisualElement.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:827
View.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\View.cs:158
BindableObject.SetInheritedBindingContext (Xamarin.Forms.BindableObject bindable, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:247
Element.SetChildInheritedBindingContext (Xamarin.Forms.Element child, System.Object context) D:\a\1\s\Xamarin.Forms.Core\Element.cs:479
Element.<OnBindingContextChanged>b__83_0 (Xamarin.Forms.BindableObject child, System.Object bc) D:\a\1\s\Xamarin.Forms.Core\Element.cs:310
BindableObjectExtensions.PropagateBindingContext[T] (Xamarin.Forms.BindableObject self, System.Collections.Generic.IList1[T] children, System.Action2[T1,T2] setChildBindingContext)
Element.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Element.cs:308
Cell.OnBindingContextChanged () D:\a\1\s\Xamarin.Forms.Core\Cells\Cell.cs:156
BindableObject.BindingContextPropertyChanged (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:550
BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:512
BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:446
BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:374
BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:349
BindableObject.set_BindingContext (System.Object value) D:\a\1\s\Xamarin.Forms.Core\BindableObject.cs:31
TemplatedItemsList`2[TView,TItem].UnhookItem (TItem item)
AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
NSAsyncSynchronizationContextDispatcher.Apply () /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs:178
(wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:86
UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:65
Application.Main (System.String[] args)

Developer technologies .NET Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2021-09-23T06:58:08.973+00:00

    Hello,
    Welcome to our Microsoft Q&A platform!

    Runtime.MissingCtor (System.IntPtr ptr, System.IntPtr klass, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution resolution)

    System.IntPtr ptr, System.Type type, ObjCRuntime.Runtime+MissingCtorResolution missingCtorResolution

    It means constructor of your class is missing. HeaderWrapperView is used in ListViewRenderer, I think it crashes when you use a Listview with header. You could have a try to create CustomRenderer to avoid crashes. You could also use CollectionView instead of Listview.

    [assembly: ExportRenderer (typeof (Label), typeof (CustomLabelRenderer))]  
    namespace MyNamespace  
    {  
    
        public class CustomLabelRenderer : LabelRenderer  
        {  
            protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)  
            {  
                //Break possibility to go to VisualElement crashing code...  
                if (e.PropertyName == VisualElement.IsVisibleProperty.PropertyName)  
                {  
                    return;  
                }  
    
                base.OnElementPropertyChanged(sender, e);  
            }  
        }  
    }  
    

    Best Regards,
    Wenyan Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.