-
Notifications
You must be signed in to change notification settings - Fork 1.9k
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'Android.Graphics.Bitmap'. #2746
Comments
Any sort of reproduction, even if it causes crashes intermittently, would be extremely helpful here. |
I do not have any reproduce steps, It happened sporadically, This was happened 11 times in last two months, Got it from Hockey report. |
I just thought I'd reference possibly duplicate bugs: #2004 I do realise |
I had the same issue and found out that it was caused by having a button in a list view cell and the table had a long press. I got around it by changing the button to a tap gesture. |
Hi mtarros, Are you able to reproduce your issue consistently? and able to resolve?, My issue is happening intermittently and unable to reproduce again and it is happening sporadically. |
It would happen intermittently also, but we did work out the steps to repeat the issue. I think it was just repeating browsing between two screens. Removing the button from the list view cell and replacing it with an image and a tap gesture solved the issue. |
I'm seeing something fairly similar inside a Xamarin Forms app on Android. The affected page has the same layout mentioned by @mtarros: a grouped listview containing items with buttons. The issue is somewhat difficult to reproduce, but for me it happens when something on the page causes the buttons to be destroyed and recreated. E.g. if you use a grouping listview and remove / re-add items to a group when the group header is tapped (which leads to an expand/collapse effect), you'll be inducing the repro scenario. My stack trace from debugger output:
|
I created a central issue for this type of exception And I'm going to close this one for now |
in the upcoming 3.2 should resolve this |
Description
This error occurs when navigating between pages. Since no user code is involved it's not possible to catch and handle the exception.
Xamarin caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Android.Graphics.Bitmap'.
Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self)<7bd6e23e74244e9191c46983d3bb2eeb>:0
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeAbstractVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters)<7bd6e23e74244e9191c46983d3bb2eeb>:0
Android.Graphics.Bitmap.Recycle()<82958282c7e341b985c12639e88fc1d1>:0
Xamarin.Forms.Platform.Android.ButtonDrawable.Reset()<173f39d71f0d4d928f5bbea42e96ffa8>:0
Xamarin.Forms.Platform.Android.ButtonDrawable.Dispose(bool disposing)<173f39d71f0d4d928f5bbea42e96ffa8>:0
Java.Lang.Object.Dispose()<82958282c7e341b985c12639e88fc1d1>:0
Xamarin.Forms.Platform.Android.ButtonBackgroundTracker.Dispose(bool disposing)<173f39d71f0d4d928f5bbea42e96ffa8>:0
Xamarin.Forms.Platform.Android.ButtonBackgroundTracker.Dispose()<173f39d71f0d4d928f5bbea42e96ffa8>:0
Xamarin.Forms.Platform.Android.ButtonRenderer.Dispose(bool disposing)<173f39d71f0d4d928f5bbea42e96ffa8>:0
Java.Lang.Object.Dispose()<82958282c7e341b985c12639e88fc1d1>:0
Xamarin.Forms.Platform.Android.VisualElementRenderer.Dispose(bool disposing)<173f39d71f0d4d928f5bbea42e96ffa8>:0
Xamarin.Forms.Platform.Android.PageRenderer.Dispose(bool disposing)<173f39d71f0d4d928f5bbea42e96ffa8>:0
Java.Lang.Object.Dispose()<82958282c7e341b985c12639e88fc1d1>:0
Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnDestroyView()<173f39d71f0d4d928f5bbea42e96ffa8>:0
Android.Support.V4.App.Fragment.n_OnDestroyView(IntPtr jnienv, IntPtr native__this)<40bb5a57295c4f648daa62e9e7aa774b>:0
at (wrapper dynamic-method) System.Object.84698d0a-0c20-40fc-87af-f3c645d9eec0(intptr,intptr)
md58432a647068b097f9637064b8985a5e0.FragmentContainer.n_onDestroyView(Native Method)
md58432a647068b097f9637064b8985a5e0.FragmentContainer.onDestroyView()FragmentContainer.java:59
android.support.v4.app.Fragment.performDestroyView()Fragment.java:2590
android.support.v4.app.FragmentManagerImpl.moveToState()FragmentManager.java:1503
android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState()FragmentManager.java:1740
android.support.v4.app.BackStackRecord.executeOps()BackStackRecord.java:794
android.support.v4.app.FragmentManagerImpl.executeOps()FragmentManager.java:2580
android.support.v4.app.FragmentManagerImpl.executeOpsTogether()FragmentManager.java:2367
android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute()FragmentManager.java:2322
android.support.v4.app.FragmentManagerImpl.execPendingActions()FragmentManager.java:2229
android.support.v4.app.FragmentManagerImpl$1.run()FragmentManager.java:700
android.os.Handler.handleCallback()Handler.java:739
android.os.Handler.dispatchMessage()Handler.java:95
android.os.Looper.loop()Looper.java:168
android.app.ActivityThread.main()ActivityThread.java:5845
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:797
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:687
Steps to Reproduce
Happened Intermittently, No steps to reproduce.
But it is happened and crashed the app and reported in Hockey.
Expected Behavior
It should not crash the app.
Actual Behavior
It is crashing the app
Basic Information
Screenshots
Reproduction Link
The text was updated successfully, but these errors were encountered: