Bug 60750 - System.ObjectDisposedException: Cannot access a disposed object.
Summary: System.ObjectDisposedException: Cannot access a disposed object.
Status: NEEDINFO
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- critical
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-11-18 17:55 UTC by softsan
Modified: 2018-04-12 16:06 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 60750 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEEDINFO

Description softsan 2017-11-18 17:55:45 UTC
I have a Xamarin.Forms app with a SyncFusion List view (SfListView). It causes a frequent crash on Android with following error:

 

    Unhandled exception: System.ObjectDisposedException: Cannot access a disposed object.
     Object name: 'Syncfusion.ListView.XForms.Android.ExtendedScrollViewRenderer'.
    at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <7cfbebb561c54efc9010b018c0846c7e>:0 
     at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <7cfbebb561c54efc9010b018c0846c7e>:0 
     at Android.Views.View.get_IsLayoutRequested () [0x0000a] in <9ef29c909d7e4606a46b131129da3975>:0 
      at Xamarin.Forms.Platform.Android.ScrollViewRenderer+<OnScrollToRequested>d__58.MoveNext () [0x000ce] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:309 
     --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
    at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <896ad1d315ca4ba7b117efb8dacaedcf>:0 
    at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <9ef29c909d7e4606a46b131129da3975>:0 
    at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <9ef29c909d7e4606a46b131129da3975>:0 
    at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <9ef29c909d7e4606a46b131129da3975>:0 
    at (wrapper dynamic-method) System.Object:ab79b1ac-9c45-4d56-89ec-c42ce2376e50 (intptr,intptr)

I already contacted SyncFusion and they says its a framework issue. So i am posting this bug here.

Used with Xamarin.Forms 2.3 to 2.5 (latest) but still the issue is there.
Any suggestion or thoughts on this?
Comment 1 Paul DiPietro [MSFT] 2017-11-18 18:29:48 UTC
Can you please give us a reproduction preferably using only Forms controls?
Comment 2 Mohammad 2018-04-12 15:32:59 UTC
Hi,
I have exactly the same issue.
+ Xamarin.Forms 2.4.0.91020

================================
          Error Log
================================
04-05 16:09:51.496 E/mono    ( 8521): 
04-05 16:09:51.496 E/mono    ( 8521): Unhandled Exception:
04-05 16:09:51.496 E/mono    ( 8521): System.ObjectDisposedException: Cannot access a disposed object.
04-05 16:09:51.496 E/mono    ( 8521): Object name: 'Syncfusion.ListView.XForms.Android.ExtendedScrollViewRenderer'.
04-05 16:09:51.496 E/mono    ( 8521):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <3cb12bce834a498199b2be6cd3e00922>:0 
04-05 16:09:51.496 E/mono    ( 8521):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <3cb12bce834a498199b2be6cd3e00922>:0 
04-05 16:09:51.496 E/mono    ( 8521):   at Android.Views.View.get_IsLayoutRequested () [0x0000a] in <ff199c98c3f84852925dd37a0ef6113a>:0 
04-05 16:09:51.496 E/mono    ( 8521):   at Xamarin.Forms.Platform.Android.ScrollViewRenderer+<OnScrollToRequested>d__57.MoveNext () [0x000ce] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:301 
04-05 16:09:51.496 E/mono    ( 8521): --- End of stack trace from previous location where exception was thrown ---
04-05 16:09:51.496 E/mono    ( 8521):   at (wrapper dynamic-method) System.Object.295165a3-b795-4e50-ba35-ce10b2a80c6c(intptr,intptr)
04-05 16:09:51.498 E/mono-rt ( 8521): [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
04-05 16:09:51.498 E/mono-rt ( 8521): Object name: 'Syncfusion.ListView.XForms.Android.ExtendedScrollViewRenderer'.
04-05 16:09:51.498 E/mono-rt ( 8521):   at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <3cb12bce834a498199b2be6cd3e00922>:0 
04-05 16:09:51.498 E/mono-rt ( 8521):   at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <3cb12bce834a498199b2be6cd3e00922>:0 
04-05 16:09:51.498 E/mono-rt ( 8521):   at Android.Views.View.get_IsLayoutRequested () [0x0000a] in <ff199c98c3f84852925dd37a0ef6113a>:0 
04-05 16:09:51.498 E/mono-rt ( 8521):   at Xamarin.Forms.Platform.Android.ScrollViewRenderer+<OnScrollToRequested>d__57.MoveNext () [0x000ce] in D:\agent\_work\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:301 
04-05 16:09:51.498 E/mono-rt ( 8521): --- End of stack trace from previous location where exception was thrown ---
04-05 16:09:51.498 E/mono-rt ( 8521):   at (wrapper dynamic-method) System.Object.295165a3-b795-4e50-ba35-ce10b2a80c6c(intptr,intptr)
04-05 16:09:51.499 D/        ( 8521): HostConnection::get() New Host Connection established 0xc762e900, tid 8521
Comment 3 Mohammad 2018-04-12 16:06:57 UTC
I think it is the same as this bug:
https://bugzilla.xamarin.com/show_bug.cgi?id=45330