This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 43469 - execute await App.Current.MainPage.DisplayAlert() twice will crash on UWP real phone
Summary: execute await App.Current.MainPage.DisplayAlert() twice will crash on UWP rea...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.1
Hardware: PC Windows
: Normal major
Target Milestone: UWP
Assignee: Bugzilla
URL:
: 49491 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-17 15:57 UTC by Mike
Modified: 2017-02-02 19:07 UTC (History)
7 users (show)

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


Attachments
sample (79.27 KB, application/x-rar)
2016-08-17 15:57 UTC, Mike
Details

Description Mike 2016-08-17 15:57:19 UTC
Created attachment 17084 [details]
sample

This will let application crash on real phone.  not on desktop application.   I'm testing it on Lumia 640XL


btn.Clicked += (sender, argas) =>
            {

                Device.BeginInvokeOnMainThread(new Action(async () =>
                {
                    await App.Current.MainPage.DisplayAlert("test", "test", "cancel");
                }));

                Device.BeginInvokeOnMainThread(new Action(async () =>
                {
                    await App.Current.MainPage.DisplayAlert("test", "test", "cancel");
                }));

            };



I also upload the sample you could test it.
Comment 1 Daniel 2016-12-08 16:49:51 UTC
Hi there,

this bug exists on Windows 8.1 and there is no way to catch the exception thrown inside DisplayAlert task. Here is a link https://forums.xamarin.com/discussion/comment/238949#Comment_238949 to discussion created on Xamarin forum. To reproduce the issue please use demo project I have created to demonstrate the issue: https://github.com/MrClockOff/DisplayAlerTest

Cheers,
Dan
Comment 2 Paul DiPietro [MSFT] 2016-12-08 19:27:18 UTC
Hi,

We're aware of this bug and have a potential fix in place (https://github.com/xamarin/Xamarin.Forms/pull/347), but have to do some reviewing of it to decide if it's the best solution. This doesn't guarantee that this particular fix will be used, but I've brought attention back onto it since we let it stagnate a bit.
Comment 3 E.Z. Hart 2016-12-09 19:15:55 UTC
*** Bug 49491 has been marked as a duplicate of this bug. ***
Comment 4 Rui Marinho 2016-12-16 16:03:08 UTC
Should be fixed in 2.3.4-pre2
Comment 5 Parmendra Kumar 2017-02-02 17:50:34 UTC
I have checked this issue with Xamarin.Forms 2.3.4.184-pre1 and this issue not reproducible with latest forms version. To verify this issue I have used sample provided in comment #1.

Hence marked this issue as Verified Fixed.

Thanks.
Comment 6 Parmendra Kumar 2017-02-02 19:07:45 UTC
An update for comment #5,

By mistake I have checked this issue with simulator and local machine and this issue is related to real device.
Hence changed status to Resolved Fixed, I will retest this issue with real phone and update for the same.

Thanks.

Note You need to log in before you can comment on or make changes to this bug.