Bug 28456 - Crash when navigating between pages with Lists
Summary: Crash when navigating between pages with Lists
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-03-26 10:54 UTC by Sten
Modified: 2016-04-08 19:28 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Sten 2015-03-26 10:54:53 UTC
In my app I have 3 pages with ListViews, where tapping an item navigates to the next page

After a few taps back and forth I get this exception and the app crashes:


System.Diagnostics.Debugger.Mono_UnhandledException_internal () in 
System.Diagnostics.Debugger.Mono_UnhandledException (ex={System.ArgumentException: 'jobject' must not be IntPtr.Zero.
Parameter name: jobject
at Android.Runtime.JNIEnv.CallIntMethod (intptr,intptr) <IL 0x0001f, 0x000cc>
at Android.Widget.AdapterView.get_FirstVisiblePosition () <IL 0x0004e, 0x001af>
at Xamarin.Forms.Platform.Android.ListViewAdapter.SelectItem (object) <IL 0x00027, 0x00113>
at Xamarin.Forms.Platform.Android.ListViewAdapter.OnItemSelected (object,Xamarin.Forms.SelectedItemChangedEventArgs) <IL 0x00017, 0x000cb>
at (wrapper delegate-invoke) System.EventHandler`1<Xamarin.Forms.SelectedItemChangedEventArgs>.invoke_void_object_TEventArgs (object,Xamarin.Forms.SelectedItemChangedEventArgs) <0x00067>
at Xamarin.Forms.ListView.OnSelectedItemChanged (Xamarin.Forms.BindableObject,object,object) <IL 0x0001c, 0x00103>
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.BindableObject/SetValueFlags,bool) <IL 0x00115, 0x007a7>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) <IL 0x0023e, 0x00e1f>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags) <IL 0x00005, 0x00067>
at Xamarin.Forms.ListView.NotifyRowTapped (int,int) <IL 0x00051, 0x00287>
at Xamarin.Forms.ListView.NotifyRowTapped (int) <IL 0x00025, 0x0014b>
at Xamarin.Forms.Platform.Android.ListViewAdapter.HandleItemClick (Android.Widget.AdapterView,Android.Views.View,int,long) <IL 0x00029, 0x0015f>
at Xamarin.Forms.Platform.Android.CellAdapter.OnItemClick (Android.Widget.AdapterView,Android.Views.View,int,long) <IL 0x0002c, 0x001eb>
at Android.Widget.AdapterView/IOnItemClickListenerInvoker.n_OnItemClick_Landroid_widget_AdapterView_Landroid_view_View_IJ (intptr,intptr,intptr,intptr,int,long) <IL 0x00020, 0x0018b>
at (wrapper dynamic-method) object.3784fd7f-dd55-4689-920d-38b1bd8dc179 (intptr,intptr,intptr,intptr,int,long) <IL 0x00029, 0x0009b>
}) in 
object.3784fd7f-dd55-4689-920d-38b1bd8dc179 (arg0=0x41a91f38, arg1=0xfffffffffb000019, arg2=0xffffffffb4c0001d, arg3=0xffffffffc5500021, arg4=1, arg5=0) in 
Android.Runtime.JNIEnv.CallIntMethod (jobject=0x0, jmethod=0x6d69f880) in 
Android.Widget.AdapterView.get_FirstVisiblePosition () in 
Xamarin.Forms.Platform.Android.ListViewAdapter.SelectItem (item={AuditorDB.Model.Area}) in 
Xamarin.Forms.Platform.Android.ListViewAdapter.OnItemSelected (sender={Xamarin.Forms.ListView}, eventArg={Xamarin.Forms.SelectedItemChangedEventArgs}) in 
Xamarin.Forms.ListView.OnSelectedItemChanged (bindable={Xamarin.Forms.ListView}, oldValue=(null), newValue={AuditorDB.Model.Area}) in 
Xamarin.Forms.BindableObject.SetValueActual (property=SelectedItem, context={Xamarin.Forms.BindableObject.BindablePropertyContext}, value={AuditorDB.Model.Area}, currentlyApplying=false, attributes=Xamarin.Forms.BindableObject+SetValueFlags.ClearDynamicResource|Xamarin.Forms.BindableObject+SetValueFlags.ClearOneWayBindings|Xamarin.Forms.BindableObject+SetValueFlags.RaiseOnEqual, silent=false) in 
Xamarin.Forms.BindableObject.SetValueCore (property=SelectedItem, value={AuditorDB.Model.Area}, attributes=, privateAttributes=) in 
Xamarin.Forms.BindableObject.SetValueCore (Parameters=) in 
Xamarin.Forms.ListView.NotifyRowTapped (Parameters=) in 
Xamarin.Forms.ListView.NotifyRowTapped (Parameters=) in 
Xamarin.Forms.Platform.Android.ListViewAdapter.HandleItemClick (Parameters=) in 
Xamarin.Forms.Platform.Android.CellAdapter.OnItemClick (Parameters=) in 
Android.Widget.AdapterView.IOnItemClickListenerInvoker.n_OnItemClick_Landroid_widget_AdapterView_Landroid_view_View_IJ (Parameters=) in 
object.3784fd7f-dd55-4689-920d-38b1bd8dc179 (Parameters=) in
Comment 1 Danish Akhtar 2015-04-01 01:55:57 UTC
Hi Sten,

Could you please provide your app and Xamarin build info via Xamarin Studio->About Xamarin Studio->Show Details->Copy info ? So that we can try to reproduce this issue at our end.

Thanks
Comment 2 Jason Smith [MSFT] 2016-04-08 19:28:31 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team