Bug 24713 - [MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] System.InvalidOperationException: Page must not already have a parent. at Xamarin.Forms.NavigationProxy.PushAsync (Xamarin.Forms.Page root) thrown when double-tapping button
Summary: [MonoDroid] UNHANDLED EXCEPTION: [MonoDroid] System.InvalidOperationException...
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.0
Hardware: Macintosh Mac OS
: Highest normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-11-20 20:14 UTC by Kent Green [MSFT]
Modified: 2015-01-12 17:33 UTC (History)
5 users (show)

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


Attachments
Sample & Logs (70.75 KB, application/zip)
2014-11-20 20:14 UTC, Kent Green [MSFT]
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:
RESOLVED INVALID

Description Kent Green [MSFT] 2014-11-20 20:14:40 UTC
Created attachment 8825 [details]
Sample & Logs

---Overview---
From this priority case:
https://xamarin.desk.com/agent/case/105244

Customer contacted support regarding their app crashing on an OutOfMemory exception in Android, as well as crashing behavior when quickly selecting through pages. They sent a sample app for testing, I haven't found much info on the first issue, but I discovered that double-tapping on a button in their sample app threw an Unhandled Exception when testing in Android.

I also tried adding an iOS project (app is entirely within Forms) and could *not* reproduce the crash on iOS.

---Expected Behavior---
Quickly double-tapping button in sample app should not cause an unhandled exception and crash in Android.

---Actual Behavior---
Causes a crash, and produces the following exception in the Application Output:
>[MonoDroid] UNHANDLED EXCEPTION:
>[MonoDroid] System.InvalidOperationException: Page must not already have a parent.
>[MonoDroid]   at Xamarin.Forms.NavigationProxy.PushAsync (Xamarin.Forms.Page root) [0x00000] in <filename unknown>:0 
>[MonoDroid]   at AndroidList.RootPage+<NavigateTo>c__async0.MoveNext () [0x00022] in /Users/kentgreen/Downloads/MemoryLeak/MemoryLeak/AndroidList/AndroidList/RootPage.cs:84

---Steps to reproduce---
1. Run app
2. Quickly tap button multiple times, before next page comes up.

---Build Information---
=== Xamarin Studio ===

Version 5.6.2 (build 5)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
Runtime:
	Mono 3.10.0 ((detached/633e444)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 310000020

=== Apple Developer Tools ===

Xcode 6.1 (6604)
Build 6A1052d

=== Xamarin.iOS ===

Version: 8.4.0.38 (Business Edition)
Hash: 9e57461
Branch: 
Build date: 2014-11-10 21:18:38-0500

=== Xamarin.Android ===

Version: 4.99.0 (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

=== Xamarin.Mac ===

Version: 1.11.1.89 (Business Edition)

=== Build Information ===

Release ID: 506020005
Git revision: 19bc3b64b70332bfab18faf9cf1ce7d3aa191b36
Build date: 2014-10-17 14:49:01-04

=== Operating System ===

Mac OS X 10.10.0
Darwin Kents-MacBook-Pro-3.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64

----Additional Info---
I tried some baseline tests with some of our sample apps, double-clicking buttons etc.; I couldn't find a way to repo the issue outside of the specific approach in the sample project.
Comment 1 Udham Singh 2014-12-05 09:38:54 UTC
I have check this issue and I have also getting the same Exception mentioned in the bug description.

Screencast: http://www.screencast.com/t/UgVgFq2dE
ApplicationOutputLog: https://gist.github.com/Parmendrak/08eb31a30991164ed787
BuildLog: https://gist.github.com/Parmendrak/9ed68b9e582511a1d65b
DeviceLog: https://gist.github.com/Parmendrak/153d4c27a611009d3aa9
IdeLog: https://gist.github.com/Parmendrak/9451f0cd4a6f32bd111a

Environment Info:
=== Xamarin Studio ===

Version 5.5.4 (build 15)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Runtime:
	Mono 3.12.0 ((detached/18666b6)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 312000063

=== Xamarin.Android ===

Version: 4.20.0.28 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Apple Developer Tools ===

Xcode 6.1 (6602)
Build 6A1052c

=== Xamarin.iOS ===

Version: 8.4.0.43 (Business Edition)
Hash: 840a925
Branch: 
Build date: 2014-11-16 21:03:22-0500

=== Xamarin.Mac ===

Version: 1.10.0.18 (Business Edition)

=== Build Information ===

Release ID: 505040015
Git revision: f93940a35458a18052f1a25e106e62ca970d9c40
Build date: 2014-11-19 15:32:41-05
Xamarin addins: dc23cbd91a3a0e1d326328e1229e86c942a49ec8

=== Operating System ===

Mac OS X 10.9.4
Darwin ShrutiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64