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 thrown when adding or deleting items to/from ItemsSource #72

Closed
brakonier946 opened this issue Jul 25, 2019 · 1 comment

Comments

@brakonier946
Copy link

commented Jul 25, 2019

Platform (please complete the following information):

  • OS: Android
  • Device: Xiaomi Mi A2/Redmi Note 4
  • Sdk vervion: Android SDK 28
  • Xamarin.Forms: 3.6.0.344457

Describe the bug
Sometime when I add or remove one item i have this error

Exceptions (if applicable)
07-25 17:43:37.479 D/Mono (16922): DllImport attempting to load: '/system/lib64/liblog.so'.
07-25 17:43:37.483 D/Mono (16922): DllImport loaded library '/system/lib64/liblog.so'.
07-25 17:43:37.483 D/Mono (16922): DllImport searching in: '/system/lib64/liblog.so' ('/system/lib64/liblog.so').
07-25 17:43:37.483 D/Mono (16922): Searching for '__android_log_print'.
07-25 17:43:37.483 D/Mono (16922): Probing '__android_log_print'.
07-25 17:43:37.483 D/Mono (16922): Found as '__android_log_print'.
07-25 17:43:37.491 I/MonoDroid(16922): UNHANDLED EXCEPTION:
07-25 17:43:37.494 I/MonoDroid(16922): System.ObjectDisposedException: Cannot access a disposed object.
07-25 17:43:37.494 I/MonoDroid(16922): Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer+RecycleViewAdapter'.
07-25 17:43:37.494 I/MonoDroid(16922): at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <23e57773773243b6853e76fc01957c33>:0
07-25 17:43:37.494 I/MonoDroid(16922): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <23e57773773243b6853e76fc01957c33>:0
07-25 17:43:37.494 I/MonoDroid(16922): at Android.Support.V7.Widget.RecyclerView+Adapter.NotifyItemRemoved (System.Int32 position) [0x00022] in <7d32f6ecea2f48a59f0d551b445680b3>:0
07-25 17:43:37.495 I/MonoDroid(16922): at Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer+RecycleViewAdapter+<>c__DisplayClass26_0.b__0 () [0x00060] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\HorizontalList\AndroidHorizontalListViewRenderer.RecycleViewAdapter.cs:398
07-25 17:43:37.495 I/MonoDroid(16922): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0
07-25 17:43:37.495 I/MonoDroid(16922): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in :0
07-25 17:43:37.495 I/MonoDroid(16922): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.52(intptr,intptr)
07-25 17:43:37.521 E/AppCenterCrashes(16922): Unhandled Exception from source=AndroidEnvironment
07-25 17:43:37.521 E/AppCenterCrashes(16922): System.ObjectDisposedException: Cannot access a disposed object.
07-25 17:43:37.521 E/AppCenterCrashes(16922): Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer+RecycleViewAdapter'.
07-25 17:43:37.521 E/AppCenterCrashes(16922): at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <23e57773773243b6853e76fc01957c33>:0
07-25 17:43:37.521 E/AppCenterCrashes(16922): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeNonvirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <23e57773773243b6853e76fc01957c33>:0
07-25 17:43:37.521 E/AppCenterCrashes(16922): at Android.Support.V7.Widget.RecyclerView+Adapter.NotifyItemRemoved (System.Int32 position) [0x00022] in <7d32f6ecea2f48a59f0d551b445680b3>:0
07-25 17:43:37.521 E/AppCenterCrashes(16922): at Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer+RecycleViewAdapter+<>c__DisplayClass26_0.b__0 () [0x00060] in D:\Dev\Sharpnado\src\Xamarin-Forms-Practices\Sharpnado.Presentation.Forms\Sharpnado.Presentation.Forms.Droid\Renderers\HorizontalList\AndroidHorizontalListViewRenderer.RecycleViewAdapter.cs:398
07-25 17:43:37.521 E/AppCenterCrashes(16922): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0
07-25 17:43:37.521 E/AppCenterCrashes(16922): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in :0
07-25 17:43:37.521 E/AppCenterCrashes(16922): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.52(intptr,intptr)
07-25 17:43:37.535 D/Mono (16922): Loading reference 5 of /storage/emulated/0/Android/data/com.stormlion.ddbel/files/.override/Microsoft.AppCenter.Crashes.dll asmctx DEFAULT, looking for System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
07-25 17:43:37.610 D/Mono (16922): Assembly Ref addref Microsoft.AppCenter.Crashes[0x7230669d80] -> System.Core[0x72306cae80]: 15
07-25 17:43:37.858 W/stormlion.ddbe(16922): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
07-25 17:43:37.862 D/Mono (16922): DllImport searching in: '__Internal' ('(null)').
07-25 17:43:37.862 D/Mono (16922): Searching for 'java_interop_jnienv_throw'.
07-25 17:43:37.862 D/Mono (16922): Probing 'java_interop_jnienv_throw'.
07-25 17:43:37.862 D/Mono (16922): Found as 'java_interop_jnienv_throw'.
System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer+RecycleViewAdapter'.'

07-25 17:43:38.922 E/mono-rt (16922): [ERROR] FATAL UNHANDLED EXCEPTION: System.ObjectDisposedException: Cannot access a disposed object.
07-25 17:43:38.922 E/mono-rt (16922): Object name: 'Sharpnado.Presentation.Forms.Droid.Renderers.HorizontalList.AndroidHorizontalListViewRenderer+RecycleViewAdapter'.
07-25 17:43:38.922 E/mono-rt (16922): at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.52(intptr,intptr)
07-25 17:43:38.922 E/mono-rt (16922): at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.52(intptr,intptr)

@yinyue200

This comment has been minimized.

Copy link

commented Aug 25, 2019

same issue

@roubachof roubachof moved this from To do to In progress in Kanban board Aug 27, 2019
@roubachof roubachof moved this from In progress to Done in Kanban board Aug 27, 2019
@roubachof roubachof closed this in 945869e Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.