SfButton inside TableView, Cannot access a disposed object, Object name: 'SfButtonRenderer'

Hello

I am using Syncfusion.Xamarin.Forms 18.3.0.42.

My application sometimes crashes, when accessing the settings page, that contains a TableView. In the TableView, there are some labels, switch cells and some custom cells. These custom cells contain SfBussons.
When accessing the page a few times, an error occurs: Cannot access a disposed object. Object name: 'SfButtonRenderer'.

This only happens on an iOS device/simulator. On UWP it works fine.

Could you please have a look at this?


Here is the stack trace:

at Foundation.NSObject.get_SuperHandle () [0x00012] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/Foundation/NSObject2.cs:394
  at UIKit.UIView.SetNeedsDisplay () [0x00023] in /Library/Frameworks/Xamarin.iOS.framework/Versions/14.0.0.0/src/Xamarin.iOS/UIKit/UIView.g.cs:1767
  at Syncfusion.XForms.iOS.Border.SfBorderRenderer.UpdateProperties (System.Boolean isCornerRadiusUpdated, System.Boolean isBackgroundColorUpdated, System.Boolean isBorderColorUpdated, System.Boolean isBorderWidthUpdated, System.Boolean hasShadowUpdated, System.Boolean isDashArrayUpdated, System.Boolean isShadowColorUpdated) [0x001db] in <d21a6df4b87c4249a15f362557cfb646>:0
  at Syncfusion.XForms.iOS.Border.SfBorderRenderer.OnSizeChanged (System.Object sender, System.EventArgs e) [0x00000] in <d21a6df4b87c4249a15f362557cfb646>:0
  at (wrapper delegate-invoke) <Module>.invoke_void_object_EventArgs(object,System.EventArgs)
  at Xamarin.Forms.VisualElement.SetSize (System.Double width, System.Double height) [0x00029] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:1047
  at Xamarin.Forms.VisualElement.set_Bounds (Xamarin.Forms.Rectangle value) [0x0005d] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:357
  at Xamarin.Forms.VisualElement.Layout (Xamarin.Forms.Rectangle bounds) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:724
  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
  at Xamarin.Forms.Platform.iOS.ViewCellRenderer+ViewTableCell.LayoutSubviews () [0x00081] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Cells\ViewCellRenderer.cs:97
  at Xamarin.Forms.Platform.iOS.CellTableViewCell.GetNativeCell (UIKit.UITableView tableView, Xamarin.Forms.Cell cell, System.Boolean recycleCells, System.String templateId) [0x000dc] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Cells\CellTableViewCell.cs:94
  at Xamarin.Forms.Platform.iOS.TableViewModelRenderer.GetCell (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x0001d] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\TableViewModelRenderer.cs:34
  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/14.0.0.0/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/14.0.0.0/src/Xamarin.iOS/UIKit/UIApplication.cs:65
  at MyProject.iOS.Application.Main (System.String[] args) [0x00002] in D:\.Net\MyProject\MyProject\MyProject.iOS\Main.cs:15


Kind regards
Phil

8 Replies 1 reply marked as answer

YP Yuvaraj Palanisamy Syncfusion Team October 27, 2020 04:20 PM UTC

 
Greetings from Syncfusion. 
 
We have analyzed your query and we have prepared the sample based on your requirement “Use SfButton in Xamarin.Forms Table View Custom cell”.  
 
Also, we have attached the sample in the below link for your reference. 
 
  
Could you please check the attached sample and please share your use case scenario if possible, please modify the sample with reproduce issue, which will be helpful to serve you better solution at the earliest. 
 
Regards, 
Yuvaraj 


Marked as answer

UN Unknown October 30, 2020 03:29 PM UTC

Thank you for your reply.

In the sample you provided, all things worked fine.
In my app it is the same, if the page is only displayed like that.

In the meantime I decided to not use the TableView anymore and then the crash does not happen anymore.

Thus there is nothing more to do here.

Thank you once again for your help.


YP Yuvaraj Palanisamy Syncfusion Team November 2, 2020 04:44 PM UTC

Hi Phil, 

Thanks for your update. 

As per your stack trace report we suspect to fix the reported issue and we have generated the custom assemblies for that fix. Please find the custom assemblies in the below link.  

  
Please let us know whether the reported issue has been resolved at your end. 

Regards, 
Yuvaraj 



UN Unknown November 3, 2020 09:17 AM UTC

Thank you for the custom assemblies.

Now it is the first time, that I get assemblies like that, so I am not sure how to use and where to put them.
In the folder of the nuget packages that I reference in my project (...\.nuget\packages\syncfusion.xamarin.core\18.3.0.44\lib)? 

The assemblies you provided have version 14.4350.0.55, which seems quite old, how can I reference them?

Sorry for asking such basic question.


Kind regards
Phil


YP Yuvaraj Palanisamy Syncfusion Team November 4, 2020 12:45 PM UTC

Hi Phil, 
  
We would like to let you know that we have fixed the reported issue in UWP based on your stack trace report. Please find the custom assemblies from the below link, 
  
  
Assembly Version: 18.3.0.44 
  
You can replace the assemblies as follows.  
  
Remove the existing dll or nuget from the project files (PCL or .Net and XForms.UWP).  
  
Delete the package folder of the sample (eg., D: \ sample \ packages).  
  
Now refer the new assemblies.  
  
Could you please let us know whether the issue resolves at your end with the provided custom assemblies?. Which is helpful to include this in our source level. 
  
Regards, 
Yuvaraj. 



UN Unknown November 9, 2020 08:28 AM UTC

With the custom assemblies I was unable to reproduce the reported issue as well.
So I guess the changes that you've made fixed this issue.

Thank you very much for your help.


HM Hemalatha Marikumar Syncfusion Team November 10, 2020 01:33 PM UTC

Hi Phil, 
 
Thanks for your update and we are glad to hear that given solution works.  
 
We will check the development team for moving this issue fix in our official release and get back to you with complete details on tomorrow (November 11,2020) 
 
Regards,
Hemalatha M. 



HM Hemalatha Marikumar Syncfusion Team November 11, 2020 09:43 AM UTC

Hi Phil, 
 
We are glad to announce that our weekly NuGet was rolled out and fix for the reported issue was included in the weekly NuGet.  
  
NuGet Version: 18.3.0.48 
  
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards,
Hemalatha M.
 


Loader.
Up arrow icon