Cannot access a disposed object

I am currently getting the following errors while using Xamarin.Forms 2.3.3.193. I am unable to reproduce this in debug mode, but users are experiencing it occasionally. I am wondering if an asynchronous method I am calling is trying to display data after a view has already been removed the main thread, but am not sure.

Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.FormsTextView'. ExceptionType: ObjectDisposedException LogEventType: ExceptionDataPoint MachineName: And-401 Message: UnhandledException Module: Android StackTrace: at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00030] in <2d019897586c4f93b071eeda597bd7d2>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00001] in <2d019897586c4f93b071eeda597bd7d2>:0 at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence value) [0x00028] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at Android.Widget.TextView.set_Text (System.String value) [0x00013] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at Xamarin.Forms.Platform.Android.LabelRenderer.UpdateText () [0x00098] in <556464d784854d58957ce21f4c5eb182>:0 at Xamarin.Forms.Platform.Android.LabelRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x000c5] in <556464d784854d58957ce21f4c5eb182>:0 at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x000fb] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in <bf304fc411724e23a42595b76799a13a>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at (wrapper dynamic-method) System.Object:ca0adfc0-2d29-4379-ab35-86d56b9dbf58 (intptr,intptr)

java.lang.reflect.InvocationTargetException ExceptionType: RuntimeException InnerException: Java.Lang.ReflectiveOperationException: Exception of type 'Java.Lang.ReflectiveOperationException' was thrown.;System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.FormsTextView'.; LogEventType: ExceptionDataPoint MachineName: And-401 Message: UnhandledException Module: Android StackTrace: --- End of managed Java.Lang.RuntimeException stack trace --- java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:714) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:919) ... 1 more Caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Xamarin.Forms.Platform.Android.FormsTextView'. at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00030] in <2d019897586c4f93b071eeda597bd7d2>:0 at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00001] in <2d019897586c4f93b071eeda597bd7d2>:0 at Android.Widget.TextView.set_TextFormatted (Java.Lang.ICharSequence value) [0x00028] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at Android.Widget.TextView.set_Text (System.String value) [0x00013] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at Xamarin.Forms.Platform.Android.LabelRenderer.UpdateText () [0x00098] in <556464d784854d58957ce21f4c5eb182>:0 at Xamarin.Forms.Platform.Android.LabelRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x000c5] in <556464d784854d58957ce21f4c5eb182>:0 at (wrapper delegate-invoke) <Module>:invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) at Xamarin.Forms.BindableObject.OnPropertyChanged (System.String propertyName) [0x00012] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.Element.OnPropertyChanged (System.String propertyName) [0x00000] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x000fb] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0014b] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in <bf304fc411724e23a42595b76799a13a>:0 at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in <bf304fc411724e23a42595b76799a13a>:0 at Java.Lang.Thread+RunnableImplementor.Run () [0x0000b] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <5fc66edb7e3c40c9b029fa84765c6952>:0 at (wrapper dynamic-method) System.Object:ca0adfc0-2d29-4379-ab35-86d56b9dbf58 (intptr,intptr) at mono.java.lang.RunnableImplementor.n_run(Native Method) at mono.java.lang.RunnableImplementor.run(RunnableImplementor.java:30) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254)

Sign In or Register to comment.