exception when listview gets new items populated SfListView.RefreshLayoutandView

new Bug after upgrading to 19.1 from 18.x
XF 5.0.0.2012
only in Android 
didn't had any problem before updating.
The actual listview is not even in View yet when the exception is raised. 
this is happening on real devices, but not in different simulators

[AppCenterCrashes] Unhandled Exception from source=AndroidEnvironment
[AppCenterCrashes] System.NullReferenceException: Object reference not set to an instance of an object.
[AppCenterCrashes]   at Syncfusion.ListView.XForms.SfListView.RefreshLayoutandView () [0x0003f] in <5703c8101a634bfa9a28b1f5a70b489e>:0 
[AppCenterCrashes]   at Syncfusion.ListView.XForms.SfListView.OnSizeAllocated (System.Double width, System.Double height) [0x0001d] in <5703c8101a634bfa9a28b1f5a70b489e>:0 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:872 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.SetSize (System.Double width, System.Double height) [0x00021] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:1104 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle value) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:411 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle bounds) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:781 
[AppCenterCrashes]   at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x001da] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:157 
[AppCenterCrashes]   at Xamarin.Forms.Grid.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x00150] in D:\a\1\s\Xamarin.Forms.Core\GridCalc.cs:43 
[AppCenterCrashes]   at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:239 
[AppCenterCrashes]  06-08 15:06:36.071 E/AppCenterCrashes(17794):   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:872 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.SetSize (System.Double width, System.Double height) [0x00021] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:1104 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle value) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:411 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle bounds) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:781 
[AppCenterCrashes]   at Xamarin.Forms.Layout.LayoutChildIntoBoundingRegion (Xamarin.Forms.VisualElement child, Xamarin.Forms.Rectangle region) [0x001da] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:157 
[AppCenterCrashes]   at Xamarin.Forms.ScrollView.LayoutChildren (System.Double x, System.Double y, System.Double width, System.Double height) [0x000f8] in D:\a\1\s\Xamarin.Forms.Core\ScrollView.cs:237 
[AppCenterCrashes]   at Xamarin.Forms.Layout.UpdateChildrenLayout () [0x00158] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:239 
[AppCenterCrashes]   at Xamarin.Forms.Layout.OnSizeAllocated (System.Double width, System.Double height) [0x0000f] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:203 
[AppCenterCrashes]   at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:872 
[AppCenterCrashes]   at Xamarin.Forms.Layout.ResolveLayoutChanges () [0x00069] in D:\a\1\s\Xamarin.Forms.Core\Layout.cs:374 
[AppCenterCrashes]   at Xamarin.Forms.Platform.Android.VisualElementRenderer`1[TElement].OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00014] in D:\a\1\s\Xamarin.Forms.Platform.Android\VisualElementRenderer.cs:513 
[AppCenterCrashes]   at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in /Users/builder/azdo/_work/1/s/xamarin-android/src/Mono.Android/obj/Release/monoandroid10/android-29/mcw/Android.Views.View.cs:17648 
[AppCenterCrashes]   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.33(intptr,intptr,int,int)
**System.NullReferenceException:** 'Object reference not set to an instance of an object.

3 Replies 1 reply marked as answer

MI Michael June 10, 2021 06:26 AM UTC

It looks like this was caused by using the binding to Datasource but binding the Itemsource to the actual collection instead of the Datasource.Source

issue can be closed.


LN Lakshmi Natarajan Syncfusion Team June 10, 2021 03:09 PM UTC

Hi Michael, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “exception when listview gets new items populated SfListView.RefreshLayoutandView” from our side. We have added possible null checks in our source based on the stack trace and included in our upcoming Weekly Nuget release which is planned to roll out on June 15, 2021. We appreciate your patience until then.  
  
Meanwhile, thank you for the information. We are glad that the issue resolved at your side. Please let us know if you need further assistance. As always we are happy to help you out.
 
Regards, 
Lakshmi Natarajan 



LN Lakshmi Natarajan Syncfusion Team June 16, 2021 03:24 AM UTC

Hi Michael, 
 
Thank you for your patience. 
 
We have fixed the reported issue “exception when listview gets new items populated SfListView.RefreshLayoutandView” and included the issue fix in our latest Weekly NuGet release update version 19.1.0.69 which is available for download (https://www.nuget.org/).     
   
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.     
 
Lakshmi Natarajan 
 


Marked as answer
Loader.
Up arrow icon