Bug 31580 - 'jobject' must not be IntPtr.Zero in Android.Support.V4.View.ViewPager.set_CurrentItem(int)
Summary: 'jobject' must not be IntPtr.Zero in Android.Support.V4.View.ViewPager.set_Cu...
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.3
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-07-02 12:01 UTC by Grégory Journé
Modified: 2016-04-11 02:47 UTC (History)
5 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 NORESPONSE

Description Grégory Journé 2015-07-02 12:01:15 UTC
I have a CarouselPage with ItemsSource binded to an ObservableCollection (in XAML).

The first time I display the page, everything is OK. But if I try to replace the binded ObservableCollection, I get a "System.ArgumentException: 'jobject' must not be IntPtr.Zero." with the following stack trace:

System.ArgumentException: 'jobject' must not be IntPtr.Zero.
at Android.Runtime.JNIEnv.CallVoidMethod (intptr,intptr,Android.Runtime.JValue*) [0x00010] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:563
at Android.Support.V4.View.ViewPager.set_CurrentItem (int) <IL 0x00066, 0x001c3>
at Xamarin.Forms.Platform.Android.CarouselPageAdapter.UpdateCurrentItem () <IL 0x00047, 0x0011c>
at Xamarin.Forms.Platform.Android.CarouselPageAdapter.OnPagesChanged (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs) <IL 0x00023, 0x0008f>
at (wrapper delegate-invoke) <Module>.invoke_void_object_NotifyCollectionChangedEventArgs (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs) <IL 0x0002f, 0x00066>
at Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>.OnPagesChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs) <0x00054>
at Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>.Reset () <0x0058b>
at Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>.OnTemplatedItemsChanged (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs) <0x0101b>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>, Xamarin.Forms.ContentPage>.OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs) <0x00051>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>, Xamarin.Forms.ContentPage>.OnProxyCollectionChanged (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs,bool) <0x01aaf>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>, Xamarin.Forms.ContentPage>.OnProxyCollectionChanged (object,System.Collections.Specialized.NotifyCollectionChangedEventArgs) <0x00043>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>, Xamarin.Forms.ContentPage>.OnItemsSourceChanged (bool) <0x0030b>
at Xamarin.Forms.TemplatedItemsList`2<Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>, Xamarin.Forms.ContentPage>.BindableOnPropertyChanged (object,System.ComponentModel.PropertyChangedEventArgs) <0x00093>
at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x0002f, 0x00066>
at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x0002f, 0x00066>
at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x0002f, 0x00066>
at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs (object,System.ComponentModel.PropertyChangedEventArgs) <IL 0x0002f, 0x00066>
at Xamarin.Forms.BindableObject.OnPropertyChanged (string) <IL 0x00012, 0x00090>
at Xamarin.Forms.MultiPage`1<Xamarin.Forms.ContentPage>.OnPropertyChanged (string) <0x00327>
at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,Xamarin.Forms.BindableObject/BindablePropertyContext,object,bool,Xamarin.Forms.BindableObject/SetValueFlags,bool) <IL 0x000ff, 0x00457>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags,Xamarin.Forms.BindableObject/SetValuePrivateFlags) <IL 0x0023e, 0x0099f>
at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,Xamarin.Forms.BindableObject/SetValueFlags) <IL 0x00005, 0x0004f>
at Xamarin.Forms.BindingExpression.ApplyCore (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty,bool) <IL 0x001e7, 0x00a53>
at Xamarin.Forms.BindingExpression.Apply (bool) <IL 0x00041, 0x000fb>
at Xamarin.Forms.BindingExpression/BindingExpressionPart.<PropertyChanged>b__c () <IL 0x00007, 0x0002f>
at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Java.Lang.IRunnable.cs:71
at (wrapper dynamic-method) object.f1333fa9-b02a-4751-b182-833e274ba6fb (intptr,intptr) <IL 0x00011, 0x0001f>
Comment 1 Grégory Journé 2015-07-02 12:39:46 UTC
It seems that it only happens if I close and reopen the CarouselPage.
The second time the page is displayed, I get an exception as soon as I try to replace or to modify the binded ObservableCollection.
Comment 2 Grégory Journé 2015-07-02 13:43:45 UTC
Maybe related to the Bug 29769
Comment 3 Parmendra Kumar 2015-07-07 14:10:38 UTC
@Grégory

I have checked this issue but I am not able to reproduce this issue.
Could you please provide me a sample project? so that I can reproduce this issue at my end.

Thanks.
Comment 4 Jason Smith [MSFT] 2016-04-11 02:47:46 UTC
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.

Warm regards,
Xamarin Forms Team