question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Regression: unhandled exception rendering charts using Xamarin Forms.

See original GitHub issue

Describe the bug

Unhandled exception rendering charts using Xamarin Forms. This is a regression in version 0.9.0. Version 0.7.1 worked fine.

System.ArgumentNullException: ‘Value cannot be null. Parameter name: text’

Stack trace:

 	0xFFFFFFFFFFFFFFFF in System.Diagnostics.Debugger.Mono_UnhandledException_internal	C#	Annotated Frame
 	0x1 in System.Diagnostics.Debugger.Mono_UnhandledException at /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:125,4	C#	Annotated Frame
 	0x26 in Android.Runtime.DynamicMethodNameCounter.104	C#	Annotated Frame
 	0xD in SkiaSharp.SKCanvas.DrawText	C#	Annotated Frame
 	0xD in SkiaSharp.SKCanvas.DrawText	C#	Annotated Frame
 	0x19C in Microcharts.PointChart.DrawLabels	C#	Annotated Frame
 	0x65 in Microcharts.PointChart.DrawFooter	C#	Annotated Frame
 	0x102 in Microcharts.LineChart.DrawContent	C#	Annotated Frame
 	0x29 in Microcharts.Chart.Draw	C#	Annotated Frame
 	0x35 in Microcharts.Forms.ChartView.OnPaintCanvas	C#	Annotated Frame
 	0xD in SkiaSharp.Views.Forms.SKCanvasView.OnPaintSurface	C#	Annotated Frame
 	0x2 in SkiaSharp.Views.Forms.SKCanvasView.SkiaSharp.Views.Forms.ISKCanvasViewController.OnPaintSurface	C#	Annotated Frame
 	0x21 in SkiaSharp.Views.Forms.SKCanvasViewRendererBase<SkiaSharp.Views.Forms.SKCanvasView,SkiaSharp.Views.Android.SKCanvasView>.OnPaintSurface	C#	Annotated Frame
 	0xD in SkiaSharp.Views.Android.SKCanvasView.OnPaintSurface	C#	Annotated Frame
 	0xE3 in SkiaSharp.Views.Android.SKCanvasView.OnDraw	C#	Annotated Frame
 	0x11 in Android.Views.View.n_OnDraw_Landroid_graphics_Canvas_	C#	Annotated Frame
 	0x17 in Android.Runtime.DynamicMethodNameCounter.104	C#	Annotated Frame
 	0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a	C#	Annotated Frame
 	0x79 in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod	C#	Annotated Frame
 	0x5F in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod	C#	Annotated Frame
 	0x38 in Android.Views.View.Draw	C#	Annotated Frame
 	0x19 in Xamarin.Forms.Platform.Android.VisualElementRenderer<SkiaSharp.Views.Forms.SKCanvasView>.Draw at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:402,4	C#	Annotated Frame
 	0x11 in Android.Views.View.n_Draw_Landroid_graphics_Canvas_	C#	Annotated Frame
 	0x17 in Android.Runtime.DynamicMethodNameCounter.40	C#	Annotated Frame
 	0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a	C#	Annotated Frame
 	0x79 in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod	C#	Annotated Frame
 	0x5F in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod	C#	Annotated Frame
 	0x38 in Android.Views.View.Draw	C#	Annotated Frame
 	0x14 in Xamarin.Forms.Platform.Android.FastRenderers.FrameRenderer.Draw at D:\a\1\s\Xamarin.Forms.Platform.Android\FastRenderers\FrameRenderer.cs:227,4	C#	Annotated Frame
 	0x11 in Android.Views.View.n_Draw_Landroid_graphics_Canvas_	C#	Annotated Frame
 	0x17 in Android.Runtime.DynamicMethodNameCounter.40	C#	Annotated Frame
 	0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a	C#	Annotated Frame
 	0x79 in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod	C#	Annotated Frame
 	0x5F in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod	C#	Annotated Frame
 	0x38 in Android.Views.View.Draw	C#	Annotated Frame
 	0x19 in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.Page>.Draw at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:402,4	C#	Annotated Frame
 	0x11 in Android.Views.View.n_Draw_Landroid_graphics_Canvas_	C#	Annotated Frame
 	0x17 in Android.Runtime.DynamicMethodNameCounter.40	C#	Annotated Frame
 	0xFFFFFFFFFFFFFFFF in Java.Interop.NativeMethods.java_interop_jnienv_call_nonvirtual_void_method_a	C#	Annotated Frame
 	0x79 in Java.Interop.JniEnvironment.InstanceMethods.CallNonvirtualVoidMethod	C#	Annotated Frame
 	0x5F in Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod	C#	Annotated Frame
 	0x38 in Android.Views.View.Draw	C#	Annotated Frame
 	0x19 in Xamarin.Forms.Platform.Android.VisualElementRenderer<Xamarin.Forms.NavigationPage>.Draw at D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:402,4	C#	Annotated Frame
 	0x11 in Android.Views.View.n_Draw_Landroid_graphics_Canvas_	C#	Annotated Frame
 	0x17 in Android.Runtime.DynamicMethodNameCounter.40	C#	Annotated Frame

Which platform and version is this for?

Android

To Reproduce

This is a simplified version of the code I’m using to create a chart:

            List<ChartEntry> entries = new List<ChartEntry>(100);
            for (int i = 0; i < 100; i++)
            {
                double altitude = SOME POSITIVE VALUE;
                ChartEntry entry = new ChartEntry(altitude);

                if (i % 20 == 0)
                    entry.ValueLabel = altitude.ToString();

                entries.Add(entry);
            }

            LineChart chart = new LineChart
            {
                Entries = entries,
                LineMode = LineMode.Straight,
                PointMode = PointMode.None,
                MinValue = 0,
            };

Expected behavior No unhandled exceptions. Or if I’m setting the chart up wrong, an exception at setup time telling me I what I did wrong.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mfeingolcommented, Aug 5, 2020

It appears to be fixed in 0.9.5.5. But you might want to double-check me on that.

1reaction
eman1986commented, Aug 5, 2020

I’ve been busy with a few fires, I should be able to look into this pretty soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug] Regression: unhandled exception rendering charts ...
Describe the bug Unhandled exception rendering charts using Xamarin Forms. This is a regression in version 0.9.0. Version 0.7.1 worked fine.
Read more >
unhandled exception rendering charts using Xamarin Forms.
Describe the bug. Unhandled exception rendering charts using Xamarin Forms. This is a regression in version 0.9.0. Version 0.7.1 worked fine ...
Read more >
Microcharts
Describe the bug. Unhandled exception rendering charts using Xamarin Forms. This is a regression in version 0.9.0. Version 0.7.1 worked fine. System.
Read more >
Xamarin.Forms - An unhandled error occurs when rotating ...
Dear Team, The Pie Chart is working fine on rotation, but when i click on the chart and the hint shows up and...
Read more >
Creating new project failed Visual Studio Mac
Reinstalling VS or Mono doesn't help. I have tried other versions of Mono. ![INFO [2021-07-22 00:11:12Z]: Starting Visual Studio 2019 for Mac ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found