Bug 34272 - System.ArgumentException: 'jobject' must not be IntPtr.Zero. when popping back on page with listview
Summary: System.ArgumentException: 'jobject' must not be IntPtr.Zero. when popping bac...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.5.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-09-25 05:04 UTC by Fokke Vermeulen
Modified: 2016-04-13 19:36 UTC (History)
6 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 Fokke Vermeulen 2015-09-25 05:04:58 UTC
firstView = view includes a searchField and a listview for the searched products
secondView = view includes a searchField and a listview for the suggestion for typed characters.

The click in the firstView on the searchField will push on the secondView. When I tap here any cellItem or press the Done-Button on the keyboard after entered a character, I will pop back to the firstView.

Sometimes when I search really fast pop back to the firstView and scroll immediately down, the app will crash with an ArgumentException.

The workaround is:

to set the content = null on every OnDisAppearing() and InitializeComponents() on every OnAppearing();


StackTrace:
-----------

System.ArgumentException: 'jobject' must not be IntPtr.Zero.
Parameter name: jobject
  at at Android.Runtime.JNIEnv.CallBooleanMethod (intptr,intptr,Android.Runtime.JValue*) <IL 0x0001f, 0x000e0>
  at at Android.Views.GestureDetector.OnTouchEvent (Android.Views.MotionEvent) <IL 0x00066, 0x002ab>
  at at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.Android.Views.View.IOnTouchListener.OnTouch (Android.Views.View,Android.Views.MotionEvent) <0x000c3>
  at at Android.Views.View/IOnTouchListenerInvoker.n_OnTouch_Landroid_view_View_Landroid_view_MotionEvent_ (intptr,intptr,intptr,intptr) <IL 0x0001c, 0x0014b>
  at at (wrapper dynamic-method) object.2886220c-a4a6-4d3e-a5ad-2e8610914833 (intptr,intptr,intptr,intptr) <IL 0x0001d, 0x00053>

Only tested it on Android 4.1 to 5.1.1 
On all devices it happened
Comment 1 E.Z. Hart [MSFT] 2016-04-13 19:36:28 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