Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
This is a bit of a strange one. I have a custom button renderer which allows me to attach a custom font to a button. It overrides ButtonRenderer as shown:
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
var label = (CustomFontButton)Element;
var font = UIFont.FromName(label.FontName, label.FontSize > 0 ? (float)label.FontSize : 12.0f);
if (font != null)
Control.Font = font;
As you can see, the code does not check to make sure that Element is not null before accessing it. It turns out that on iOS, when the non-modal page hosting this control was popped, the code above generated a null pointer exception trying to access the element after it was nulled out.
However, instead of this exception crashing the app, or at least being logged to the console, the only noticeable side-effect was that the Navigation Popped event did not fire. I added a check to ensure the Element and Control are not null before accessing them; the problem went away and the Popped event started working again.
Although it's nice that Xamarin Forms managed to keep my app running despite this bug, it took me a long time to track down why the Popped event was mysteriously not working. It would be better to make sure the event still fires, and better yet to log something to the console if your code traps an unexpected exception and handles it.
I have tried to reproduced this issue and unable to reproduce the reported behavior at my end.
Could you please attach Test sample application with a small testcase.
Also add IDE Log, Application Output and environment info.
You will find these details via:
1. IDE log: Help-> Open Log Directory.
2. Environment info: Help-> About-> Show Details-> Copy Information.
This is due to the way async/await works. .NET 4.5 in its infinite wisdom decided to silently swallow exceptions on background threads, YAY. You only get them if you await the results. Make sure you are awaiting all your async calls or this happens.
I am awaiting async calls in my code. As described, the issue is that the popped event is not getting fired. Are you awaiting async calls in your code?
Just to be clear. When this happened I was awaiting the Navigation.PopModalAsync() call, which did not propagate the error. The error was swallowed somewhere in Xamarin's code.