SfTabView ObjectDisposedException on navigation back

I've spent all morning trying to look into this issue and to eliminate my own code as being the cause. I am now confident enough to report what I believe to be a bug.

I am using Syncfusion.Xamarin.SfTabView v16.3.0.21 in my Android application and have found that when we back out (using Navigator back button) of a page containing an SfTabView, I am getting an ObjectDisposedException under certain conditions (see below)
System.Exception: CurrentDomainOnUnhandledException ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Syncfusion.Android.TabView.ContentContainer'.
  at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <034d4a9852dd45bea9353cc7776c99f0>:0
  at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualInt32Method (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <034d4a9852dd45bea9353cc7776c99f0>:0
  at Android.Views.View.get_Width () [0x0000a] in <a10f61e70eeb434e952fef884856c199>:0
  at Syncfusion.Android.TabView.SfSwipePager.GetViewIndex (Android.Views.View view) [0x00024] in <67ab38fdbd7c42f29e6861ddc5e98c05>:0
  at Syncfusion.Android.TabView.SfSwipePager+<>c__DisplayClass44_0.<GetAnimator>b__0 (System.Object <p0>, System.EventArgs <p1>) [0x0001a] in <67ab38fdbd7c42f29e6861ddc5e98c05>:0
  at Android.Animation.AnimatorEventDispatcher.OnAnimationEnd (Android.Animation.Animator animation) [0x0000a] in <a10f61e70eeb434e952fef884856c199>:0
  at Android.Animation.Animator+IAnimatorListenerInvoker.n_OnAnimationEnd_Landroid_animation_Animator_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_animation) [0x00011] in <a10f61e70eeb434e952fef884856c199>:0
  at (wrapper dynamic-method) System.Object.103(intptr,intptr,intptr)
   --- End of inner exception stack trace ---

In order to cause this exception I have determined that it only occurs under these circumstances

  • The user has to have switched pages by swiping (switching by pressing the tabs does not cause it)
  • I have the tabview's SelectedTabIndex is bound to a property on the page model

I have also confirmed

  • I am not attempting to access the tabview once it has been disposed of (I have no code behind which is referring to the tab view since using MVVM)
  • The only time the bound property is being set, is when  the user switches pages via the UI and not from my code

Having searched the forum I see many threads relating to ObjectDisposedException,

This post seemed to be reporting the same exception on the same control, but seems to be unresolved, not confirmed as a bug, and possibly distracted by the use of GorillaPlayer.

This post seemed to reporting the same exception due to the same trigger of navigating back, though on a different control. I find the one reply from the Syncfusion support agent to be wholly unsatisfactory for anybody but the original poster


Thanks

Paul






7 Replies

PA Paul Anderson S Syncfusion Team October 25, 2018 11:19 AM UTC

Hi Paul, 
  
Thanks for the detailed investigation on the reported issue. Is it possible for you to share a video of the replication of the error and is this occuring only in your application of even in a simple project doing the same replication to reproduce. These details will help as get the the issue reproduced at our end since we have many lines of code getting called while swiping from different classes fixing with the stacktrace will throw the exception in some other method. 
  
Please share the details which will be helpful in addressing the issue. 
  
Regards, 
Paul Anderson 



PP Paul Parkins October 25, 2018 01:04 PM UTC

Took a few attempts to get the video small enough to comply with your 30Mb limit. Apologies for getting the orientation wrong.

I'll have a go at simulating the problem with a small app (or a cut down version of my actual app).

Paul

Attachment: ObjectDisposedException_c6954f03.zip


PP Paul Parkins October 25, 2018 04:19 PM UTC

Hi,
I knocked up a simple application but the problem did not surface itself. I am wondering if it is something particular to my application or the combination of packages being used by it (for example, I am using FreshMvvM to apply MVVM). Therefore I have decided to try and produce a minimal cutdown version of my actual application that will still reproduce the problem.

Am still working on this, but as this is likely to contain some code which is owned by the company I work for, is it possible that I could supply this project privately rather than publicly? If you were to provide me with an email address (either here or through my account), I can then provide a link to somewhere that can host my demo project.


Thanks

Paul


PA Paul Anderson S Syncfusion Team October 26, 2018 04:39 AM UTC

Hi Paul, 
 
We have created a new support incident to have further followups as you per your request to share the files in private. We will assist you through incident under your Direct Trac account.  
 
Our Direct Trac support system can be accessed from the following link:                                 
 
Regards, 
Paul Anderson 



PP Paul Parkins November 2, 2018 12:12 PM UTC

For other interested readers, I managed to produce a cutdown application that demonstrated the issue. It was confirmed to be a fault, and a solution was promised by Nov 2nd.

Nov 2nd came and they did release a new version of Syncfusion, and it did fix my problem. So if you have the same issue, you need to upgrade to  SP release 16.3.0.29 or later

Once again, I am very impressed with Syncfusion's support, and ability to deliver what was promised on schedule. Thanks for your help Paul Anderson, and the Syncfusion team!


Paul


IO IoTFier November 9, 2018 11:31 AM UTC

Hi  @ Paul Anderson / Syncfucion.

My original post is https://www.syncfusion.com/forums/140170/memory-leak-system-objectdisposedexception-sftabview

This error is still occurring with usage of the latest version 1.5.0.0 of Gorilla player.
I am using SfTabView in my Xamarin Forms app.

Unfortunately I have faced NullException errors on multiple Syncfusion controls including SfTabView, SfCalendar and SfSchedule.

It seriously sounds like a base code hygiene issue in base code writing / review and QA processing.

Can you please help in addressing this error on SfTabView and other great controls of yours ?

Thanks



PA Paul Anderson S Syncfusion Team November 14, 2018 11:33 AM UTC

Hi Nilesh, 
 
We will assist you through incident under your Direct Trac account that was already having followup details with SfTabView issue to avoid confusions and duplicates.  
 
Our Direct Trac support system can be accessed from the following link:  
                                
 
Regards, 
Paul Anderson 


Loader.
Up arrow icon