We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfChart throw null reference exception when application running on iOS

Hi all,

We use SfChart in our xamarin forms app. All components are working as well in android but in the ios sfchart components throw null exception and application is crashing. How I can fix this error? 

SfComponent version:
Xamarin froms version:

  at Syncfusion.SfChart.iOS.SFChart.MeasureLegend () [0x0002d] in <45e49b78aad8463bacfc698a15a14b28>:0 
  at Syncfusion.SfChart.iOS.SFChart.UpdateChart () [0x00570] in <45e49b78aad8463bacfc698a15a14b28>:0 
  at Syncfusion.SfChart.iOS.SFChart.LayoutSubviews () [0x00006] in <45e49b78aad8463bacfc698a15a14b28>:0 
  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/ 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0000e] in /Library/Frameworks/Xamarin.iOS.framework/Versions/ 
  at FeedBackMobile.iOS.Application.Main (System.String[] args) [0x00001] in C:\Users\skarahan\Projects\FeedbackMobile\FeedBackMobile\FeedBackMobile.iOS\Main.cs:17 

6 Replies

SK Salih KARAHAN July 29, 2019 02:20 PM UTC

Does anyone need any other information about of this issue? 🙄

RA Rachel A Syncfusion Team July 30, 2019 06:57 AM UTC

Hi Salih, 
Thanks for contacting Syncfusion Support. 
We have checked with simple sample using provided version, but we are unable to reproduce the reported issue at our end. We have attached the prepared sample for your reference. Currently we are checking our source code based on the provided call stack.  
In the meantime, can you please modify the attached sample and revert to us which will be helpful to investigate further.  

OM Oluwakemi Mafe February 10, 2023 09:42 PM UTC

Hi Rachel,

I'm having the same exception as was mentioned above. Below is a stacktrace for the exception. I've version of the Syncfusion.Xamarin.SfChart pluggin and Xamarin.Forms version

Please help with the instructions for fixing it, thanks.

{"exception": {
"type": "System.NullReferenceException",
"message": "Object reference not set to an instance of an object",
"stackTrace": " at Syncfusion.SfChart.iOS.SFChart.MeasureLegend () <0x1033acc10 + 0x000b0> in
at Syncfusion.SfChart.iOS.SFChart.UpdateChart () <0x1033a8710 + 0x01353> in 
at Syncfusion.SfChart.iOS.SFChart.LayoutSubviews () <0x1033a86e0 + 0x0001b> in
at (wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,string[],intptr,intptr,intptr&) at
UIKit.UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, 
System.IntPtr delegateClassName) <0x10170c750 + 0x00033> in
<153620f857f54f9c9ab1e7a1e6853772#f75147d7b4b47c546bd51b7c691b6216>:0 at 
UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName)
<0x10170c820 + 0x0005f> in <153620f857f54f9c9ab1e7a1e6853772#f75147d7b4b47c546bd51b7c691b6216>:0 
at SmartRock.iOS.Application.Main (System.String[] args) <0x1005e2140 + 0x00023> in :0 ",
"frames": [ {
"code": "Syncfusion.SfChart.iOS.SFChart.MeasureLegend () <0x1033acc10 + 0x000b0> in 
"className": "Syncfusion.SfChart.iOS.SFChart", "methodName": "MeasureLegend ()" },
{ "code": "Syncfusion.SfChart.iOS.SFChart.UpdateChart () <0x1033a8710 + 0x01353> in 
"className": "Syncfusion.SfChart.iOS.SFChart", "methodName": "UpdateChart ()" },
{ "code": "Syncfusion.SfChart.iOS.SFChart.LayoutSubviews () <0x1033a86e0 + 0x0001b> in
"className": "Syncfusion.SfChart.iOS.SFChart", "methodName": "LayoutSubviews ()" },
{ "code": "(wrapper managed-to-native) UIKit.UIApplication.xamarin_UIApplicationMain(int,string[],intptr,intptr,intptr&)" },
{ "code": "UIKit.UIApplication.UIApplicationMain (System.Int32 argc, System.String[] argv, System.IntPtr principalClassName, 
System.IntPtr delegateClassName) <0x10170c750 + 0x00033> in 
"className": "UIKit.UIApplication", "methodName": "UIApplicationMain (System.Int32 argc, System.String[] argv,
System.IntPtr principalClassName, System.IntPtr delegateClassName)" },
{ "code": "UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, 
System.String delegateClassName) <0x10170c820 + 0x0005f> in
"className": "UIKit.UIApplication", "methodName": "Main (System.String[] args, System.String principalClassName,
System.String delegateClassName)" },
{ "code": "SmartRock.iOS.Application.Main (System.String[] args) <0x1005e2140 + 0x00023> in :0"
"className": ".iOS.Application", "methodName": "Main (System.String[] args)"
} ],
"wrapperSdkName": "appcenter.xamarin"

RR Raja Ramalingam Syncfusion Team February 13, 2023 12:11 PM UTC

Hi Salih Karahan,

We kindly request that to check if the NuGet packages have been installed correctly in your project. It would also be helpful if you could confirm whether you are using only SfChart.XForms or if you are using it in conjunction with SfChart.IOS. If you are installed both, it is possible that the issue you are experiencing may occur.

Please check your installation once again by referring to the SfChart Getting Started page.


Best regards,


OM Oluwakemi Mafe replied to Raja Ramalingam February 13, 2023 04:15 PM UTC

Hello Raja, 

Thanks for your response. I believe that the project only uses SfChart.XForms and I doubt this is an installation problem, because it was working fine with no crashes in the past.

RR Raja Ramalingam Syncfusion Team February 14, 2023 11:36 AM UTC

Hi Oluwakemi,

We tested the reported issue using version, but we were unable to reproduce it. We have attached the sample for your reference.

Could you please provide us with a sample that reproduces the issue so we can investigate it further?

Best regards,


Attachment: ChartSample_d0238706.zip

Live Chat Icon For mobile
Up arrow icon