Bug 21418 - DisplayActionSheet still pops up two modal views on iOS and crashes app with exception.
Summary: DisplayActionSheet still pops up two modal views on iOS and crashes app with ...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-07-17 20:55 UTC by Dan DeBilt
Modified: 2015-01-31 01:25 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 Dan DeBilt 2014-07-17 20:55:17 UTC
When awaiting a DisplayActionSheet Task, two action sheets will pop up. After closing both of them with either action, a System.InvalidOperationException is thrown and the app crashes. It cannot be caught, but can be observed in the domain's unhandled exception event. The exception message is "The underlying Task is already in one of the three final states: RanToCompletion, Faulted, or Canceled."

This is a priority issue for me, as it is stopping a lot of my app's features from working properly (since I have choose to re-create my company's app entirely in Xamarin.Forms).
Comment 1 Jason Smith [MSFT] 2014-07-17 21:04:36 UTC
We are having a hard time reproducing this bug, can you help us with a reproduction case?
Comment 2 Dan DeBilt 2014-07-17 21:56:06 UTC
I figured there was a problem on my end once you mentioned that you couldn't reproduce it. So, I eventually found the difference in my app vs. the samples. My app changes the RootViewController on the UIWindow.

My app is set up to show a LoginPage (ContentPage) initially, and after logging in successfully, I switch the RootViewController to a RootPage (MasterDetailPage). The reasoning is that I didn't like the flicker of showing a modal login screen after the splash screen disappears.

My guess is that switching RootViewControllers is not supported with Forms?
Comment 3 Jason Smith [MSFT] 2014-07-17 22:09:16 UTC
Supposed to be supported, will attempt to reproduce issue soon.
Comment 4 Jason Smith [MSFT] 2014-07-17 22:10:00 UTC
Figured out the issue
Comment 5 Dan DeBilt 2014-07-17 22:10:47 UTC
Excellent!
Comment 6 Michel Chowanski 2014-07-20 17:07:19 UTC
Same on Android and Windows Phone, if I use DisplayActionSheet in a TabbedPage.
Comment 7 Isaac Rosenberg 2014-08-13 18:28:47 UTC
(In reply to comment #6)
> Same on Android and Windows Phone, if I use DisplayActionSheet in a TabbedPage.

I'm not able to reproduce your issue. Do you have sample code?
Comment 8 Isaac Rosenberg 2014-08-13 19:23:20 UTC
(In reply to comment #6)
> Same on Android and Windows Phone, if I use DisplayActionSheet in a TabbedPage.

I'm not able to reproduce your issue. Do you have sample code?
Comment 9 Michel Chowanski 2014-08-14 08:57:16 UTC
Unfortunately not. But was probably an error in my code. Now it works on Windows Phone and Android easily without any error messages.