Native Crash Reporting in output when using SfButtons to navigate from one page and back

When using SfButtons to navigate, going to a previous page causes the Native Crash Reporting error to pop up in the output tab. The AppDelegate.cs looks like this:


 public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
LoadApplication(new App());
Syncfusion.XForms.iOS.Border.SfBorderRenderer.Init();
Syncfusion.XForms.iOS.Buttons.SfButtonRenderer.Init();

return base.FinishedLaunching(app, options);
}
}

According to the documentation for SfButton, I just need to declare the SfBorderRenderer and the SfButtonRenderer as shown above.

If the code using Sfbuttons or SfBorder are commented out of the xaml files navigation works as intended. The issue only occurs on iOS, android is unaffected.

Is there a fix for this, or did I miss something in the AppDelegate.cs? The nugets I have installed are Syncfusion.Xamarin.Buttons, Syncfusion.Xamarin.Buttons.iOS and Syncfusion.Xamarin.Core



7 Replies

RS Ruba Shanmugam Syncfusion Team June 14, 2022 02:30 PM UTC

Hi Hamdy,


We have validated your query and prepared a sample based on the provided code snippet and we have attached a sample for your reference please get it from the below link.


We ask you to try our sample and if you are still facing the issue, you can return us with more information about the replication sample. This will help us to further investigate and provide you with a better solution at the earliest possible time.


Regards,

Ruba Shanmugam


Attachment: ButtonSampleCommand_ea4c0a63.zip


HA hamdy June 15, 2022 12:45 AM UTC

Regarding the sample you provided me, when I tried to run initially with Link Frameworks SDKs only the app returned with the error 'Can't resolve the reference 'System.Void ObjCRuntime.DisposableObject::Dispose()', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.ContextActionsCell::.cctor()' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. ButtonSample.iOS

The app was able to run after switching the linker behavior to Don't Link but when I navigated from the main page to the first and then to the second page and then back the output tab displays the Native Crash Reporting Error



RS Ruba Shanmugam Syncfusion Team June 15, 2022 09:03 AM UTC

Hi Hamdy,


Query 1: When I tried to run initially with Link Frameworks SDKs only the app returned with the error


We have checked the reported issue and it’s already a known issue in the Xamarin team, check the below link.


Xamarin issue link: https://github.com/xamarin/Xamarin.Forms/issues/15280


You have already changed the link assemblies and still facing the SfButton crash. But the reported crash does not occur on our side.


Query 2: Native Crash Reporting in output when using SfButton to navigate from one page and back


We have checked the provided sample and the SfButton was not crashed on our side. Can you please share the issue reproduced sample and video with us? It will help us to provide the proper solution earliest.


Regards,

Ruba Shanmugam



HA hamdy June 16, 2022 05:04 AM UTC

When navigating back from any page in the sample the following appears in the output window:

=================================================================
Native Crash Reporting
=================================================================
Got a segv while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================


=================================================================
Native stacktrace:
=================================================================
0x1096be0d5 - /Users/dssham/Library/Developer/CoreSimulator/Devices/5E66EDCC-D588-48CC-BBC2-1F71091F0ACA/data/Containers/Bundle/Application/717E3CAC-0AAE-4623-B320-65FA23270B20/ButtonSample.iOS.app/ButtonSample.iOS : mono_dump_native_crash_info
0x1096b2bce - /Users/dssham/Library/Developer/CoreSimulator/Devices/5E66EDCC-D588-48CC-BBC2-1F71091F0ACA/data/Containers/Bundle/Application/717E3CAC-0AAE-4623-B320-65FA23270B20/ButtonSample.iOS.app/ButtonSample.iOS : mono_handle_native_crash
0x1096c4a09 - /Users/dssham/Library/Developer/CoreSimulator/Devices/5E66EDCC-D588-48CC-BBC2-1F71091F0ACA/data/Containers/Bundle/Application/717E3CAC-0AAE-4623-B320-65FA23270B20/ButtonSample.iOS.app/ButtonSample.iOS : mono_sigsegv_signal_handler_debug
0x7fff6fafbdfd - /usr/lib/system/libsystem_platform.dylib : _sigtramp
0x6000029a9020 - Unknown
0x1105b4e6a - Unknown


=================================================================
Basic Fault Address Reporting
=================================================================
Memory around native instruction pointer (0x7fff2018564a):0x7fff2018563a 00 00 00 00 00
90 4c 8b 57 08 48 8b 3f 49 89 f3 ......L.W.H.?
I..
0x7fff2018564a 45 23 5a 18 49 c1 e3 04 4d 03 5a 10 49 3b 33 75 E#Z.I...M.Z.I;3u
0x7fff2018565a 0a 4d 8b 5b 08 4d 31 d3 41 ff e3 49 83 3b 01 76 .M.[.M1.A..I.;.v
0x7fff2018566a 13 49 83 c3 10
49 3b 33 75 f1 4d 8b 5b 08 4d 31 .I...I;3u.M.[.M1


=================================================================
Managed Stacktrace:
=================================================================
at <0xffffffff>
at ObjCRuntime.Messaging:IntPtr_objc_msgSendSuper <0x000e9>
at UIKit.UIColor:get_CGColor <0x001da>
at CoreFoundation.NativeObject:Dispose <0x00074>
at Syncfusion.XForms.iOS.Border.SfBorderRenderer:Dispose <0x0055a>
at Syncfusion.XForms.iOS.Buttons.SfButtonRenderer:Dispose <0x0007a>
at Foundation.NSObject:Dispose <0x00074>
at Xamarin.Forms.Platform.iOS.VisualElementPackager:Dispose <0x002c5>
at Xamarin.Forms.Platform.iOS.VisualElementPackager:Dispose <0x00071>
at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1:Dispose <0x0024a>
at Foundation.NSObject:Dispose <0x00074>
at Xamarin.Forms.Platform.iOS.DisposeHelpers:DisposeModalAndChildRenderers <0x0030f>
at Xamarin.Forms.Platform.iOS.Platform:HandleChildRemoved <0x000d2>
at Xamarin.Forms.Element:OnDescendantRemoved <0x00120>
at Xamarin.Forms.Element:OnChildRemoved <0x001c2>
at Xamarin.Forms.VisualElement:OnChildRemoved <0x0009a>
at Xamarin.Forms.Page:InternalChildrenOnCollectionChanged <0x003c2>
at System.Collections.ObjectModel.ObservableCollection`1:OnCollectionChanged <0x000fa>
at System.Collections.ObjectModel.ObservableCollection`1:OnCollectionChanged <0x00103>
at System.Collections.ObjectModel.ObservableCollection`1:RemoveItem <0x0018a>
at System.Collections.ObjectModel.Collection`1:Remove <0x001e5>
at d__79:MoveNext <0x006d2>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1:Start <0x00222>
at Xamarin.Forms.NavigationPage:Xamarin.Forms.INavigationPageController.RemoveAsyncInner <0x001b2>
at d__79:MoveNext <0x0035f>
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start <0x001fa>
at Xamarin.Forms.Platform.iOS.NavigationRenderer:UpdateFormsInnerNavigation <0x0016a>
at d__45:MoveNext <0x001c2>
at System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start <0x0020a>
at ParentingViewController:DidMoveToParentViewController <0x00182>
at :runtime_invoke_void__this___object <0x001ab>
at <0xfff
fffff>
at UIKit.UIApplication:UIApplicationMain <0x00254>
at UIKit.UIApplication:Main <0x00172>
at ButtonSample.iOS.Application:Main <0x00092>
at :runtime_invoke_void_object <0x00198>
=================================================================

I am running this app with Visual Studio 2019



RS Ruba Shanmugam Syncfusion Team June 16, 2022 01:22 PM UTC

Hi Hamdy,


Still, the reported crash was not reproduced at our end. Can you please share the following details with us?


  1. Let us share the Xamarin.Forms & SfButton version which is used in your application.
  2. Let us share the device details (iPhone/iPhone Simulator version).


It will be helpful for proceeding further on this.


Regards,

Ruba Shanmugam



HA hamdy June 17, 2022 03:16 AM UTC

1. The Xamarin Forms version used in the app is 5.0.0.2012 while SfButtons is 20.1.0.60

2. The iPhone Simulator used was an iPhone 13 running iOS 15.4



RS Ruba Shanmugam Syncfusion Team June 17, 2022 07:30 AM UTC

Hi Hamdy,


We have created a new ticket which is under your Syncfusion account. Can you please check the further follow-ups on this for the requested issue?


Regards,

Ruba Shanmugam


Loader.
Up arrow icon