Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Android] ObjectDisposedException on Xamarin Forms Listview #2793

Closed
deepesh002 opened this issue May 22, 2018 · 5 comments
Closed

[Android] ObjectDisposedException on Xamarin Forms Listview #2793

deepesh002 opened this issue May 22, 2018 · 5 comments
Labels
p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.

Comments

@deepesh002
Copy link

Description

This error occurs when navigating between pages with complex-row listviews. Since no user code is involved it's not possible to catch and handle the exception.

Note: This has been split off as a separate bug from Issue #2421 and #2406 , based on guidance from @hartez. There are at least three other related issues.

Steps to Reproduce

Navigating pages and scrolling and coming back and forth causes the application to crash.

Expected Behavior

Should work fine

Actual Behavior

App crashes a lot while navigating to and fro pages

Basic Information

Version with issue: Latest
Last known good version: NA (tried on all versions starting 2.3)
IDE:VS 2017
Platform Target Frameworks:
Android: 8.0
Android Support Library Version: 26.1.1
Nuget Packages:
Affected Devices: Tested on Samsung Note 8, Mi Note 4 etc.

StackTrace

Xamarin caused by: android.runtime.JavaProxyThrowable: System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Xamarin.Forms.Platform.Android.FormsTextView'.
Java.Interop.JniPeerMembers.AssertSelf(IJavaPeerable self):0
Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeNonvirtualVoidMethod(string encodedMember, IJavaPeerable self, JniArgumentValue* parameters):0
Android.Widget.TextView.set_TextFormatted(ICharSequence value):0
Android.Widget.TextView.set_Text(string value):0
Xamarin.Forms.Platform.Android.LabelRenderer.UpdateText()<8783e2b68568446a8522c36407e66253>:0
Xamarin.Forms.Platform.Android.LabelRenderer.OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)<8783e2b68568446a8522c36407e66253>:0
.invoke_void_object_PropertyChangedEventArgs(object, PropertyChangedEventArgs)(wrapper delegate-invoke)
Xamarin.Forms.BindableObject.OnPropertyChanged(string propertyName)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.Element.OnPropertyChanged(string propertyName)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, BindableObject.SetValueFlags attributes, bool silent)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, BindableObject.SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value, bool fromStyle, bool checkAccess)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.Label.set_Font(Font value)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.Label.OnFontAttributesChanged(BindableObject bindable, object oldValue, object newValue)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, BindableObject.SetValueFlags attributes, bool silent)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, BindableObject.SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value, bool fromStyle, bool checkAccess)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value, bool fromStyle)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.Setter.Apply(BindableObject target, bool fromStyle)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.TriggerBase.OnConditionChanged(BindableObject bindable, bool oldValue, bool newValue)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindingCondition.OnBoundPropertyChanged(BindableObject bindable, object oldValue, object newValue)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, BindableObject.SetValueFlags attributes, bool silent)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, BindableObject.SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindingExpression.ApplyCore(object sourceObject, BindableObject target, BindableProperty property, bool fromTarget)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindingExpression.Apply(bool fromTarget)<6e20d7af277949f4a7bb952d64b81cda>:0
Xamarin.Forms.BindingExpression.BindingExpressionPart.b__47_0()<6e20d7af277949f4a7bb952d64b81cda>:0
Java.Lang.Thread.RunnableImplementor.Run():0
Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this):0
at (wrapper dynamic-method) System.Object:3fe218c1-7013-47c8-b862-f4ab1ae0ff0f (intptr,intptr)
mono.java.lang.RunnableImplementor.n_run(Native Method)
mono.java.lang.RunnableImplementor.run()RunnableImplementor.java:30
android.os.Handler.handleCallback()Handler.java:754
android.os.Handler.dispatchMessage()Handler.java:95
android.os.Looper.loop()Looper.java:163
android.app.ActivityThread.main()ActivityThread.java:6205
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run()ZygoteInit.java:904
com.android.internal.os.ZygoteInit.main()ZygoteInit.java:794

Reproduction Link

https://github.com/xamarin/Xamarin.Forms/files/1898088/xp.zip

@PureWeen
Copy link
Contributor

@deepesh002 is there anything specific you're doing with the app to cause this? I tried the sample project on a couple emulators and a physical device and I can't get it to crash. I switched between the pages as rapidly as I could and scrolled around and it never crashed for me

@PureWeen PureWeen changed the title ObjectDisposedException on Xamarin Forms Listview [Android] ObjectDisposedException on Xamarin Forms Listview May 22, 2018
@PureWeen PureWeen added p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. i/critical labels May 22, 2018
@erichedstrom
Copy link

How is this different from #2421?

@hartez
Copy link
Contributor

hartez commented May 24, 2018

How is this different from #2421?

Looks like a duplicate. I think this was a miscommunication (my fault) - I told the issue creator to create a new bug without realizing another version of it existed.

@deepesh002
Copy link
Author

Yes, created this one on suggestion of @hartez .

@deepesh002
Copy link
Author

@PureWeen , this does't happen consistently. You need to navigate to and fro for few minutes and it throws up. I'm getting regular crashes on App center on a live client project. The only difference in the live project being the data is fetched and refreshed from an API every time we visit a particular page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p/Android s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue.
Projects
None yet
Development

No branches or pull requests

4 participants