Bug 39453 - Android thorow ArgumentException: 'jobject' must not be IntPtr.Zero.
Summary: Android thorow ArgumentException: 'jobject' must not be IntPtr.Zero.
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-08 17:02 UTC by Kirill
Modified: 2017-06-19 16:21 UTC (History)
8 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 Kirill 2016-03-08 17:02:13 UTC
Xamarin Forms 2.1.0.6524
Xamarin for Visual Studio 4.0.1.96
Visual Studio 2015

Android 4.1.1 or 4.1.2 (< 17 api)

Error throw when set MainPage if before MainPage already been installed NavigationPage

Application.Current.MainPage = new NavigationPage(new MyPage);

P.S. MyPage is completely empty. Inside, no, XAML elements. Furthermore, no MyPage C # code. MyPage is a blank page. Within MyPage no ScrollView.


Error Stack:

System.ArgumentException'jobject' must not be IntPtr.Zero. Parameter name: jobject
Raw
Android.Runtime.JNIEnv.CallNonvirtualBooleanMethod(IntPtr jobject, IntPtr jclass, IntPtr jmethod)JNIEnv.g.cs:632
Android.Views.View.get_IsLayoutRequested()Android.Views.View.cs:7097
Xamarin.Forms.Platform.Android.ScrollViewRenderer.<OnScrollToRequested>d__31.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()exceptionservicescommon.cs:143
System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0(object state)AsyncMethodBuilder.cs:994
Android.App.SyncContext.<Post>c__AnonStorey0.<>m__0()SyncContext.cs:18
Java.Lang.Thread.RunnableImplementor.Run()Thread.cs:36
Java.Lang.IRunnableInvoker.n_Run(IntPtr jnienv, IntPtr native__this)Java.Lang.IRunnable.cs:71
at (wrapper dynamic-method) System.Object:ee973a8d-395c-4dc2-bcbe-e2da01c22a80 (intptr,intptr)
Comment 1 Samantha Houts [MSFT] 2016-03-10 20:49:32 UTC
Thank you for taking the time to submit the bug. We tried to reproduce the issue you reported but were unable given the description. If you could please attach a reproduction to the bug by starting with a clean Xamarin.Forms project and adding just the code necessary to demonstrate the issue we would very much appreciate it.

Warm regards,
Xamarin Forms Team
Comment 2 Hines Vaughan III 2016-06-01 16:00:25 UTC
I received the exact same exception on Android and it turned out that I was not awaiting the animated `ScrollToAsync()` call. The exception would happen when a call to ScrollToAsync was made on item 1 and then, while scrolling to item 1 was still going on, another call to ScrollToAsync was made on item 2.
Comment 3 Chris Hardy [MSFT] 2017-06-19 16:21:59 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!