Approved
Last Updated: 14 Jan 2020 09:21 by ADMIN
n/a
Created on: 17 Oct 2019 09:51
Category: Checkbox
Type: Bug Report
1
CheckBox [iOS]: NullReferenceException is thrown when RadCheckBox is positioned inside a RadListView control.

I have a StackLayout, a ListView and within the listview a RadCheckBox and a Label. The StackLayout has a binding to IsVisible with the viewmodel. The ListView binds IsVisible to another property bound in the viewmodel. When OnAppearing of the Page, the ItemsSource of the ListView is set to an ObservableCollection. Now we get a crash on iOS and a Samsung Galayxy S with Android 9:

  at Telerik.XamarinForms.PrimitivesRenderer.iOS.TKCheckBox.CleanUI () [0x00007] in <04ee5ef79f6f4ed58266679a9a47ffaf>:0 
  at Telerik.XamarinForms.PrimitivesRenderer.iOS.CheckBoxRenderer.OnElementDetached (Telerik.XamarinForms.Primitives.RadCheckBox oldElement) [0x00025] in <04ee5ef79f6f4ed58266679a9a47ffaf>:0 
  at Telerik.XamarinForms.Common.iOS.IosRendererBase`2[S,T].Dispose (System.Boolean disposing) [0x0001f] in <b3d6af25b9654b5881f5a9721531628b>:0 
  at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/Foundation/NSObject2.cs:147 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.CalculateHeightForCell (UIKit.UITableView tableView, Xamarin.Forms.Cell cell) [0x000aa] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:897 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.GetEstimatedRowHeight (UIKit.UITableView table) [0x0008c] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:812 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.UpdateEstimatedRowHeight (UIKit.UITableView tableView) [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:823 
  at Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource.DetermineEstimatedRowHeight () [0x00009] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:1271 
  at Xamarin.Forms.Platform.iOS.FormsUITableViewController.ViewWillLayoutSubviews () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ListViewRenderer.cs:1599 
  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.4.0.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.4.0.2/src/Xamarin.iOS/UIKit/UIApplication.cs:65 
  at our app......


The remedy after a lot of trial and error was to replace the ListView with the Telerik ListView. Now the App no longer crashes. I hope this helps investigating the issue, since I noticed there are similar requests in the bug reports. 

I'm using: Xamarin Forms 4.2.0.848062, Telerik2019.3.1004.1.

2 comments
ADMIN
Didi
Posted on: 14 Jan 2020 09:21

Sample crash can be reproduced with Telerik UI for Xamarin RadListView control. The issue was reproduced on iPhone X with iOS 13.3. Also same exception was reported on iPad 5th generation iOS 13.3. 

The item status is changed to "Approved". Please follow the item in order to receive an email notification when its status changes.

As the same crash was reported with the Xamarin.Forms listview on iOS and some Android devices. We will need a sample where the issue could be reproduced and on which iOS and Android devices the issue occurs.

Regards,
Didi
Progress Telerik

ADMIN
Yana
Posted on: 21 Oct 2019 14:55

Hello Christian,

I am sorry to hear you've come across such an error.

I would need more details on the exact scenario, so I could replicate and research the exception on my side. I have attached my test project that I created following the provided description. Still, it seems I am missing something important as currently I am not able to observe the exception. I am also not sure at what stage the visible state of the components is switched.

It would be really helpful if you can check the solution and modify it, so that the issue to be reproduced with it.

Thanks in advance.

Regards,
Yana
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Attached Files: