Xamarin.forms: [Bug] System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'Android.Support.Design.Widget.BottomSheetDialog'.'

Created on 22 Oct 2019  Â·  6Comments  Â·  Source: xamarin/Xamarin.Forms

With release 4.3 of Xamarin Forms, a bug has surfaced when using the Shell App template. When I have many pages in the ToolBar, about 4 tabs show at the bottom of the shell and the others will be under the 'More' ellipsis. If you open the ellisis and select a page, the app crashes with the error "System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'Android.Support.Design.Widget.BottomSheetDialog'.'

Steps to Reproduce

  1. Create a Shell App in version 4.3.0.908675 or 4.2.0.910310 of forms
  2. Add more ToolBar pages so that they overflow to show an ellipsis
  3. run the app and try to navigate to a page in the ellipsis section

Expected Behavior

Page should show as it does in earlier versions of the Xamarin Forms

Actual Behavior

The App crashes with error

"System.ObjectDisposedException: 'Cannot access a disposed object. Object name: 'Android.Support.Design.Widget.BottomSheetDialog'.'

Basic Information

  • Version with issue: 4.2.0.910310 and 4.3.0.908675
  • Last known good version: 4.2.0.848062
  • IDE: Visual Studio 2019
  • Platform Target Frameworks:

    • Android: 10
  • Android Support Library Version: 28

  • Nuget Packages:
  • Affected Devices: All
4.2.0 Android10 shell 1 high regression in-progress Android bug

Most helpful comment

I can confirm that this is fixed now, thanks.

Regards
Joel Jaisi

Sent from OnePlus 7 Pro

On Mon, Nov 18, 2019, 02:15 E.Z. Hart notifications@github.com wrote:

@joeljaisi https://github.com/joeljaisi The fix is in 4.3.0.991211
(released 4 days ago). Please update to that version and give it a try. If
you still see it in that version, I will reopen this issue.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/8145?email_source=notifications&email_token=AM6YCUNBU73S6A6MSLXYU6DQUHNAJA5CNFSM4JDNR562YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEI2J4Q#issuecomment-554804466,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM6YCUL7YAZ2576CSQUJ44LQUHNAJANCNFSM4JDNR56Q
.

All 6 comments

I updated to Xamarin.Forms 4.3.0.947036 and the issue is NOT fixed!
Capture
!

Seems the bug is not fixed as per Xamarin.Forms 4.3.0.947036


Regards

*Joel JaisiSoftware Engineer/Developer/Architect; ICT Consultant *MSE,
BBSCT, SMC,
SDC, MCT, MCSD, MCPD, MS, MCTS
Phone: +265 993 708 536 (Malawi)
+263 772 566 069 (Zimbabwe)
Skype: joel.jaisi
Email: [email protected]
Alt. Email: [email protected]


On Wed, Oct 30, 2019 at 1:52 AM Rui Marinho notifications@github.com
wrote:

Closed #8145 https://github.com/xamarin/Xamarin.Forms/issues/8145 via
0c28ed7
https://github.com/xamarin/Xamarin.Forms/commit/0c28ed76cf2b0c1d0510632348aab074e861bd91
.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/8145?email_source=notifications&email_token=AM6YCUI6KPJ4YBQ4BPX3SJLQRDEEFA5CNFSM4JDNR562YY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOUQUZH6A#event-2754188280,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM6YCUPAQ2WHHBCIPSDMUFLQRDEEFANCNFSM4JDNR56Q
.

Hi @rmarinho and @samhouts and @jsuarezruiz This issue #8145 was hastily closed while the bug is not fixed. The problem still persist even after i updated my Xamarin.Forms to current stable version 4.3.0.947036. Please relook at it. The issue can still be reproduced with the steps in the issue report.

@joeljaisi The fix is in 4.3.0.991211 (released 4 days ago). Please update to that version and give it a try. If you still see it in that version, I will reopen this issue.

I can confirm that this is fixed now, thanks.

Regards
Joel Jaisi

Sent from OnePlus 7 Pro

On Mon, Nov 18, 2019, 02:15 E.Z. Hart notifications@github.com wrote:

@joeljaisi https://github.com/joeljaisi The fix is in 4.3.0.991211
(released 4 days ago). Please update to that version and give it a try. If
you still see it in that version, I will reopen this issue.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/xamarin/Xamarin.Forms/issues/8145?email_source=notifications&email_token=AM6YCUNBU73S6A6MSLXYU6DQUHNAJA5CNFSM4JDNR562YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEEI2J4Q#issuecomment-554804466,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM6YCUL7YAZ2576CSQUJ44LQUHNAJANCNFSM4JDNR56Q
.

This bug is still not fixed...
I am seeing this on xamarin.forms 4.7.0.1142

To reproduce, on android, create a basic bottom tab based shell app with 6+ tabs, run the app and repeatedly click the more tab. I believe the issue is a double click of the more button that causes the app to crash. I am seeing this issue on live and have no special modifications its just a basic shell app with 7 tabs....

System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Google.Android.Material.BottomSheet.BottomSheetDialog'.
JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self)
JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters)
Dialog.Dismiss ()
ShellItemRenderer.OnMoreItemSelected (Xamarin.Forms.ShellSection shellSection, Google.Android.Material.BottomSheet.BottomSheetDialog dialog)
ShellItemRenderer.OnMoreItemSelected (System.Int32 shellSectionIndex, Google.Android.Material.BottomSheet.BottomSheetDialog dialog)
BottomNavigationViewUtils+<>c__DisplayClass6_1.g__clickCallback|0 (System.Object s, System.EventArgs e)
View+IOnClickListenerImplementor.OnClick (Android.Views.View v)
View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_v)

Was this page helpful?
0 / 5 - 0 ratings