Bug 26536 - [Android] NavigationPage: PushAsync throws an ArgumentException when executed during pop animation
Summary: [Android] NavigationPage: PushAsync throws an ArgumentException when executed...
Status: CLOSED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-29 04:27 UTC by David Catteuw
Modified: 2015-02-10 05:31 UTC (History)
6 users (show)

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


Attachments
Debug log extracted from Visual Studio 2013 (125.59 KB, text/plain)
2015-01-29 04:27 UTC, David Catteuw
Details


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:
CLOSED FIXED

Description David Catteuw 2015-01-29 04:27:31 UTC
Created attachment 9546 [details]
Debug log extracted from Visual Studio 2013

Overview:

When calling PushAsync while a NavigationPage is popping, the application crashes, both on hardware device and emulator. 
There is no way to detect navigation is happening.

Steps to reproduce:

- Open and run Xamarin Forms sample "WorkingWithNavigation" on Android (from https://github.com/xamarin/xamarin-forms-samples).
- Click "Next" on Page 1 to go to Page 2.
- Navigate back using the navigation bar or the hardware back button.
- Quickly press the "Next" button on Page 2 during the back navigation animation.

Actual results:

The application crashes with exception: System.ArgumentException: 'jobject' must not be IntPtr.Zero.

Expected results:

The application should not crash.

Possible solutions:

- The PushAsync waits for the Pop to complete.

- The PushAsync throws an exception we can catch.

- The XF team provides a way to detect that a NavigationPage is currently navigating. Right now I don't think we have any way to prevent this crash from happening.

Setup:

- Visual Studio 2013
- Xamarin for VS 3.9.236
- Xamarin Forms 1.3.2-pre1 and 1.3.1.6296 (same behaviour on both versions)
- Samsung Galaxy S5 Active (A4.4.2) and Xamarin Android Player Nexus 4 (KitKat) (same behaviour on both devices)

Log:

The debug log is included as an attachment.
Comment 1 Sadik Ali 2015-01-29 06:44:52 UTC
I have checked this issue and with the help of steps mentioned in bug description I am able to reproduce this issue.

Observations: When I tap the back button on the navigation bar and quickly press the Next button on same page during the back navigation animation. I observed that XS throw the following exception.

>UNHANDLED EXCEPTION:
>01-29 17:00:14.945 I/MonoDroid(16249): System.ArgumentException: 'jobject' must not be IntPtr.Zero.

Screencast: http://www.screencast.com/t/OKWZk0QZwm

Application Output: https://gist.github.com/RamChBachkheti/6808fe2a640aef9d739f
Device logs: https://gist.github.com/RamChBachkheti/eba9f95e83d693d46f88
IDE logs: https://gist.github.com/RamChBachkheti/b901d4bded95ec7952b3

Please let me know if I can provide more info to this issue.

Environment Info:

Xamarin.Forms.1.3.2.6309-pre2

Microsoft Visual Studio Professional 2012
Version 11.0.61030.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

LightSwitch for Visual Studio 2012   04938-004-0033001-02335
Microsoft LightSwitch for Visual Studio 2012

Office Developer Tools   04938-004-0033001-02335
Microsoft Office Developer Tools

Team Explorer for Visual Studio 2012   04938-004-0033001-02335
Microsoft Team Explorer for Visual Studio 2012

Visual Basic 2012   04938-004-0033001-02335
Microsoft Visual Basic 2012

Visual C# 2012   04938-004-0033001-02335
Microsoft Visual C# 2012

Visual C++ 2012   04938-004-0033001-02335
Microsoft Visual C++ 2012

Visual F# 2012   04938-004-0033001-02335
Microsoft Visual F# 2012

Visual Studio 2012 Code Analysis Spell Checker   04938-004-0033001-02335
Microsoft® Visual Studio® 2012 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Visual Studio 2012 SharePoint Developer Tools   04938-004-0033001-02335
Microsoft Visual Studio 2012 SharePoint Developer Tools

ASP.NET and Web Tools   2012.3.41009
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

NuGet Package Manager   2.6.40627.9000
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.0
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   11.1.20627.00
Microsoft SQL Server Data Tools

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.9.236.0 (d6a2cae)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   4.20.0.34 (49a04b966feb40dfdba49d57ba16249b66d606a6)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.6.0.0 (eb24bdcf5cba2c12b673a07e0a8cce368b9563b3)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified
Comment 2 Jason Smith [MSFT] 2015-02-03 00:40:28 UTC
This should be fixed in 1.3.3-pre1

Re-open if its still happening for you
Comment 3 David Catteuw 2015-02-03 02:46:34 UTC
Thank you, Jason & the rest of the XF team. I can confirm this is fixed in 1.3.3-pre1!

Great job fixing this so quickly!
Comment 4 Ram Chandra 2015-02-10 05:31:21 UTC
As per Comment 3 this issue has been fixed. Hence I am closing this issue.