- Home
- Forum
- Xamarin.Forms
- (Android) List view crashes on disposing
(Android) List view crashes on disposing
Hi,
I got these crashes when navigating back from a page which contains a SfListView.
Syncfusion.Xamarin.SfListView version: 16.2.0.41
Application logs:
[MonoDroid] System.ObjectDisposedException: Cannot access a disposed object.
[MonoDroid] Object name: 'Syncfusion.ListView.XForms.Android.ExtendedScrollViewRenderer'.
[MonoDroid] at Java.Interop.JniPeerMembers.AssertSelf (Java.Interop.IJavaPeerable self) [0x00029] in <7802aa64ad574c33adca332a3fa9706a>:0
[MonoDroid] at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualBooleanMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x00000] in <7802aa64ad574c33adca332a3fa9706a>:0
[MonoDroid] at Android.Views.View.get_IsLayoutRequested () [0x0000a] in <263adecfa58f4c449f1ff56156d886fd>:0
[MonoDroid] at Xamarin.Forms.Platform.Android.ScrollViewRenderer+<OnScrollToRequested>d__61.MoveNext () [0x000ca] in D:\a\1\s\Xamarin.Forms.Platform.Android\Renderers\ScrollViewRenderer.cs:325
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <f32579baafc1404fa37ba3ec1abdc0bd>:0
[MonoDroid] at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <f32579baafc1404fa37ba3ec1abdc0bd>:0
[MonoDroid] at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <263adecfa58f4c449f1ff56156d886fd>:0
[MonoDroid] at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <263adecfa58f4c449f1ff56156d886fd>:0
[MonoDroid] at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <263adecfa58f4c449f1ff56156d886fd>:0
[MonoDroid] at (wrapper dynamic-method) System.Object.70a325ce-b9a5-4bef-83b5-79518a67912e(intptr,intptr)
SIGN IN To post a reply.
11 Replies
MK
Muthu Kumaran Gnanavinayagam
Syncfusion Team
July 2, 2018 12:31 PM UTC
Hi Ha,
We have created an incident under your account and you can follow up the same for further details.
Regards,
G.Muthu kumaran.
AC
Aaron Coppock
July 3, 2018 02:42 PM UTC
I am seeing the same issue as well.
VR
Vigneshkumar Ramasamy
Syncfusion Team
July 5, 2018 12:41 PM UTC
Hi Aaron,
We have created an incident under your account and you can follow up the same for further details.
Regards,
Vigneshkumar R
CH
cherry
July 6, 2018 06:51 AM UTC
Hi. We also encounter this issue.
VR
Vigneshkumar Ramasamy
Syncfusion Team
July 10, 2018 04:53 AM UTC
Hi Cherry,
We have created an incident under your account and you can follow up the same for further details.
Regards,
Vigneshkumar R
AB
Adela Bascacov
September 20, 2018 02:46 PM UTC
Hello,
I am also experiencing this issue.
Is it Xamarin.Forms related? Is it inside Syncfusion? Do you know the issue?
When will a solution be released?
JN
Jayaleshwari N
Syncfusion Team
September 24, 2018 11:10 AM UTC
Hi Adela,
Thanks for using Syncfusion Products.
We have checked the reported query by navigating back and forth on our sample. Exception didn’t occur in our sample. We have attached the tested sample, please find the sample from below link.
Sample Link : http://www.syncfusion.com/downloads/support/directtrac/138401/ze/ListViewSample65461057
Can you please check with the above sample whether the reported issue occurs in our sample also. If no, please revert us back with the issue reproducible sample else share the below details, so that we can analyze your query clearly and will provide appropriate solution,
- In which version of Xamarin forms and SfListview, the issue occurs.
- If you have loaded listview in any complex layouts, please share the xaml page.
- And also how you are navigating listview when this crash occurs(like crash occurs after navigating with certain page limits)
Regards,
Jayaleshwari N
UL
ulysses
October 5, 2018 10:33 PM UTC
Hey,
ItemsSource="{Binding ItemSource}"
ItemTapped="Handle_ItemTapped"
IsVisible="{Binding IsMultiSelect, Converter={StaticResource BooleanNegatedConverter}}"
SelectionMode="Single"
ItemSize="50"
SelectionBackgroundColor="Transparent">
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<common:SelectableListItem />
</DataTemplate>
</xForms:SfListView.ItemTemplate>
</xForms:SfListView>
We're also encountering the same problem when using the syncfusion listview and prism for navigation. we get the crash when we navigate away from the SfListView (only when the list is long enough to be scrollable and its in single selectionmode). this is what the xaml looks like:
```
<xForms:SfListView x:Name="CreateEditListView"ItemsSource="{Binding ItemSource}"
ItemTapped="Handle_ItemTapped"
IsVisible="{Binding IsMultiSelect, Converter={StaticResource BooleanNegatedConverter}}"
SelectionMode="Single"
ItemSize="50"
SelectionBackgroundColor="Transparent">
<xForms:SfListView.ItemTemplate>
<DataTemplate>
<common:SelectableListItem />
</DataTemplate>
</xForms:SfListView.ItemTemplate>
</xForms:SfListView>
```
JN
Jayaleshwari N
Syncfusion Team
October 8, 2018 10:54 AM UTC
Hi Ulysses,
We have prepared the prism sample based on your requirement and navigate to the listview page and checked by navigate back. Unfortunately the reported crash does not replicate at our end. We have already fixed the reported crash in the earlier version. So can you please update the listview to latest version and check the reported crash.
For your reference we have attached the sample and you can download it from the below link.
Can you please check with the above sample whether the reported issue occurs in our sample also. If no, please revert us back with the issue reproducible sample.
Regards,
Jayaleshwari N.
UN
Unknown
Syncfusion Team
November 4, 2018 09:04 PM UTC
I have recently encountered this issue on version 16.3.0.21 however I eventually figured out that it was something wrong on my end after a few days of research.
Attachment: Example_99c6d23b.zip
My team and I utilize Prism for navigation. When navigating from PageA to PageB, if you pass a List of objects from PageA to the next intending to display that List of objects on PageB, you would pass it as a NavigationParameter.
On PageB, you can retrieve that value from the methods defined in Prism.Navigation.INavigationAware. If you directly set the retrieved value back into the variable that your ListView is bound to and then navigate away from that page, it will cause an Object Disposed Exception in the ExtendedScrollViewRenderer in Android.
I realized that I should be using the Add() function instead of directly setting the retrieved value into the bound variable because that causes a PropertyChanged event. When using the Add() function, you do not change the property, only its contents so it will instead call the CollectionChanged event.
I'm assuming SfListView's implementation causes a scroll to happen when it detects a PropertyChanged event and a CollectionChanged event does not. And when you navigate away from the page while a scroll is happening you get this crash, the issue seems to be an issue with Xamarin Forms itself and there are a few issues noted on their GitHub.
Have a look at the attached example for a visual of what I've explained here. Hope this helps everyone else!
Attachment: Example_99c6d23b.zip
RS
Rawoof Sharief Muthuja Sherif
Syncfusion Team
November 5, 2018 09:39 AM UTC
Hi Kenny,
Thanks for the update.
Regards,
Rawoof M.
SIGN IN To post a reply.
- 11 Replies
- 10 Participants
-
HA Ha
- Jun 28, 2018 02:29 AM UTC
- Nov 5, 2018 09:39 AM UTC