Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectDisposedException in MauiRecyclerView.TearDownOldElement on Android #19516

Closed
BioTurboNick opened this issue Dec 20, 2023 · 1 comment
Closed
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 t/bug Something isn't working

Comments

@BioTurboNick
Copy link
Contributor

Description

Reported frequently on a released app via AppCenter.

ObjectDisposedException in MauiRecyclerView.TearDownOldElement() on Android. Occurs on call into the base method SetAdapter.

For some reason only Android 10 and 13 have shown up, but all different phone models. I don't know what the conditions are. The app has usually been running for a long time before the crash, so this may be happening during shutdown. But it still gives a black mark in the Play Store.

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.3

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 10, Android 13

Did you find any workaround?

No response

Relevant log output

Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable )
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualVoidMethod(String , IJavaPeerable , JniArgumentValue* )
AndroidX.RecyclerView.Widget.RecyclerView.SetAdapter(Adapter )
Microsoft.Maui.Controls.Handlers.Items.MauiRecyclerView`3[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Controls.Handlers.Items.GroupableItemsViewAdapter`2[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Controls.Handlers.Items.IGroupableItemsViewSource, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Controls.Handlers.Items.IGroupableItemsViewSource, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].TearDownOldElement(ReorderableItemsView oldElement)
Microsoft.Maui.Controls.Handlers.Items.ItemsViewHandler`1[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].DisconnectHandler(RecyclerView platformView)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.Controls.ReorderableItemsView, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[AndroidX.RecyclerView.Widget.RecyclerView, Xamarin.AndroidX.RecyclerView, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].OnDisconnectHandler(View platformView)
Microsoft.Maui.Handlers.ViewHandler.OnDisconnectHandler(Object platformView)
Microsoft.Maui.Handlers.ElementHandler.DisconnectHandler(Object platformView)
Microsoft.Maui.Handlers.ElementHandler.Microsoft.Maui.IElementHandler.DisconnectHandler()
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.UpdateContent()
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.<>c.<.cctor>b__73_6(FrameRenderer h, Frame _)
Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.Controls.Frame, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
Microsoft.Maui.Controls.Handlers.Compatibility.VisualElementRenderer`1[[Microsoft.Maui.Controls.Frame, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view, IPlatformViewHandler nativeViewHandler, Action`1 onElementChanged, Frame& currentVirtualView, IPropertyMapper& _mapper, IPropertyMapper _defaultMapper, Boolean autoPackage)
Microsoft.Maui.Controls.Handlers.Compatibility.ViewHandlerDelegator`1[[Microsoft.Maui.Controls.Frame, Microsoft.Maui.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view, Action`1 onElementChanged, Boolean autoPackage)
Microsoft.Maui.Controls.Handlers.Compatibility.FrameRenderer.Microsoft.Maui.IElementHandler.SetVirtualView(IElement view)
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.LayoutViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler)
Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page)
Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.IContentViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.LayoutViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
Microsoft.Maui.Handlers.LayoutHandler.SetVirtualView(IView view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.ILayout, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.LayoutViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ElementExtensions.ToPlatform(IElement view, IMauiContext context)
Microsoft.Maui.Handlers.ContentViewHandler.UpdateContent(IContentViewHandler handler)
Microsoft.Maui.Handlers.ContentViewHandler.MapContent(IContentViewHandler handler, IContentView page)
Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Handlers.IContentViewHandler, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].<Add>b__0(IElementHandler h, IElement v)
Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElement virtualView)
Microsoft.Maui.Handlers.ElementHandler.SetVirtualView(IElement view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IView view)
Microsoft.Maui.Handlers.ContentViewHandler.SetVirtualView(IView view)
Microsoft.Maui.Handlers.ViewHandler`2[[Microsoft.Maui.IContentView, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[Microsoft.Maui.Platform.ContentViewGroup, Microsoft.Maui, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].SetVirtualView(IElement view)
Microsoft.Maui.Controls.Element.SetHandler(IElementHandler newHandler)
Microsoft.Maui.Controls.Element.set_Handler(IElementHandler value)
Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IElement.set_Handler(IElementHandler value)
Microsoft.Maui.Platform.ElementExtensions.ToHandler(IElement view, IMauiContext context)
Microsoft.Maui.Platform.ViewExtensions.ToHandler(IView view, IMauiContext context)
Microsoft.Maui.Controls.Platform.Compatibility.ShellContentFragment.OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
AndroidX.Fragment.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_(IntPtr jnienv, IntPtr native__this, IntPtr native_inflater, IntPtr native_container, IntPtr native_savedInstanceState)
Android.Runtime.JNINativeWrapper.Wrap_JniMarshal_PPLLL_L(_JniMarshal_PPLLL_L callback, IntPtr jnienv, IntPtr klazz, IntPtr p0, IntPtr p1, IntPtr p2)
@BioTurboNick BioTurboNick added the t/bug Something isn't working label Dec 20, 2023
@jsuarezruiz jsuarezruiz added platform/android 🤖 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Dec 20, 2023
@PureWeen
Copy link
Member

Duplicate of #15196

Try switching your frames to borders

@github-actions github-actions bot locked and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants