ObjectDisposedException on PopToRootAsync with animation

MaartenVergouweMaartenVergouwe NLMember ✭✭
edited October 2016 in Xamarin.Forms

I have a simple page stack and sometimes (not very often) when I get to the end of the page stack and simply asynchronously pop to root with animation, I get this crash.
I hope someone can help me with this.

System.ObjectDisposedExceptionCannot access a disposed object. Object name: 'Android.Graphics.Bitmap'.
Raw
Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self)<7839cacb42a9415ab7eaaaa62eb310a4>:0
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeAbstractVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)<7839cacb42a9415ab7eaaaa62eb310a4>:0
Android.Graphics.Bitmap.Recycle()<1983e29f997d407f89a085b71f7cc377>:0
Xamarin.Forms.Platform.Android.ButtonDrawable.Reset()<e3d80a9502b84521b638fbb10cce4a8a>:0
Xamarin.Forms.Platform.Android.ButtonDrawable.Dispose(bool disposing)<e3d80a9502b84521b638fbb10cce4a8a>:0
Java.Lang.Object.Dispose()<1983e29f997d407f89a085b71f7cc377>:0
Xamarin.Forms.Platform.Android.ButtonRenderer.Dispose(bool disposing)<e3d80a9502b84521b638fbb10cce4a8a>:0
Java.Lang.Object.Dispose()<1983e29f997d407f89a085b71f7cc377>:0
Xamarin.Forms.Platform.Android.VisualElementRenderer<TElement>.Dispose(bool disposing)<e3d80a9502b84521b638fbb10cce4a8a>:0
Xamarin.Forms.Platform.Android.PageRenderer.Dispose(bool disposing)<e3d80a9502b84521b638fbb10cce4a8a>:0
Java.Lang.Object.Dispose()<1983e29f997d407f89a085b71f7cc377>:0
Xamarin.Forms.Platform.Android.NavigationRenderer.<>c__DisplayClass24_0.<SwitchContentAsync>b__0(Animator a)<e3d80a9502b84521b638fbb10cce4a8a>:0
Xamarin.Forms.Platform.Android.NavigationRenderer.<>c__DisplayClass24_1.<SwitchContentAsync>b__1(Animator a)<e3d80a9502b84521b638fbb10cce4a8a>:0
Xamarin.Forms.Platform.Android.GenericAnimatorListener.OnAnimationEnd(Animator animation)<e3d80a9502b84521b638fbb10cce4a8a>:0
Android.Animation.AnimatorListenerAdapter.n_OnAnimationEnd_Landroid_animation_Animator_(IntPtr jnienv, IntPtr native__this, IntPtr native_animation)<1983e29f997d407f89a085b71f7cc377>:0
at (wrapper dynamic-method) System.Object:8b2acc1f-a106-400a-897c-a3654985c6bf (intptr,intptr,intptr)

Answers

  • MaartenVergouweMaartenVergouwe NLMember ✭✭
    edited October 2016

    I'm guessing this can happen if the GC has already disposed the object, but the reference is not "null" in Xamarin.Forms.Platform.Android.ButtonDrawable.

  • Vlad_ServitolaVlad_Servitola USMember ✭✭

    Same thing to me. Is there any solution to prevent this crash?

Sign In or Register to comment.