Segment control crashing on iOS when screen locking

I get this error when running on an actual iPhone (not the simulator) with link sdks on and mtouch set to --optimize=experimental-xforms-product-type --warn-on-type-ref=UIKit.UIWebView -warnaserror:1503 --optimize=force-rejected-types-removal
the mtouch because of new WebView restrictions by Apple.

Put a segment control in a template column in the sfKanBan control.  While that page is open, if you lock the screen, you get the following error. (Again only on an actual iPhone)

System.NullReferenceException: Object reference not set to an instance of an object
  at Syncfusion.iOS.Buttons.SfSegmentedControl.UpdateFlowDirection () [0x00060] in <cb943fcb54914d5bac0ade83a6a108ce>:0
  at Syncfusion.iOS.Buttons.SfSegmentedControl.LayoutSubviews () [0x00194] in <cb943fcb54914d5bac0ade83a6a108ce>:0
  at at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.20.2.2/src/Xamarin.iOS/UIKit/UIApplication.cs:86
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.20.2.2/src/Xamarin.iOS/UIKit/UIApplication.cs:65
  at Xam1.iOS.Application.Main (System.String[] args) [0x00001] in /Users/davidbrenchley/Projects/RS3/Xam1/Xam1.iOS/Main.cs:17



7 Replies 1 reply marked as answer

SP Sakthivel Palaniyappan Syncfusion Team September 2, 2020 06:31 PM UTC

Hi David,

Greeting from Syncfusion.

We have analyzed your query and checked the reported issue as per your provided information, but we could not reproduce the  issue. Please find the sample from below.

Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SegementSample-1853058370.zip

Since we do not know the exact scenario of your case, can you update the following details? 
·       Update code snippet or modified sample 
·       Update Syncfusion NuGet version 
·       Update iPhone device version  
Which will be helpful for us to investigate more about the issue and provide better solution at the earliest.

Regards,
Sakthivel P.
 



DB David Brenchley September 2, 2020 11:24 PM UTC

I ran your example as is and it worked fine.  I made a few changes to the sample and it now reproduces the issue.  The iphone version I am using is "iPhone X"

Syncfusion nuget version: 18.2.0.56 - but I also see this issue usin older versions of Xamarin Forms.
Xamarin Forms version v4.8.0.1364 - but I also see this issue using older versions of Xamarin Forms.

I believe it may be related to the mtouch setting, but I can't remove that setting or Apple doesn't let me upload the app because of the UIWebView issue that they put new restrictions on.

Attachment: SegementSample_c70c2ef2.zip


SP Sakthivel Palaniyappan Syncfusion Team September 3, 2020 04:55 PM UTC

Hi David,

Thanks for the update.

We have checked the reported issue at our end and fixed the issue based on the stack trace provided. Please find the assemblies for the reported issue below

Assembly: https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfButton-934926919.zip

Assembly Version: 18.2.0.56

Disclaimer:
Please note that we have created this patch for version 18.2.0.56 specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.

Could you please check with the above assembly and let us know if the issue is resolved at your end.

Regards,
Sakthivel P.
 



DB David Brenchley September 3, 2020 09:34 PM UTC

Oh I was so hopeful.  In your reference application you gave originally in this thread, I removed the buttons library from both ios and shared projects and replaced with the dlls you provided to fix the problem.  Cleaned and ran and it still crashes with same stacktrace. 


SP Sakthivel Palaniyappan Syncfusion Team September 4, 2020 12:23 PM UTC

Hi David,

Sorry for the inconvenience.

We have created new patch , please find the patch for this below.

Assembly:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/SfButton-1379200935.zip

Assembly Version: 18.2.0.56

Disclaimer:
Please note that we have created this patch for version 18.2.0.56 specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received.

Could you please check with the above assembly and let us know if the issue is resolved at your end.

Regards,
Sakthivel P.
 


Marked as answer

DB David Brenchley September 9, 2020 04:57 PM UTC

This fixed the issue on the sample project but still getting the issue on my project.  I've moved on and created a control myself that doesn't crash.


SP Sakthivel Palaniyappan Syncfusion Team September 10, 2020 06:26 AM UTC

Hi David,

Thanks for the update. Please let us know whether you need any further assistance on this.

Regards,
Sakthivel P.


Loader.
Up arrow icon