My Xamarin.Forms app is getting an ArgumentNullException on startup. If I ignore it, it continues anyway but is unstable.
The exception is always displayed right after LoadApplication but is being thrown from somewhere deeper in the call stack
My problem is that if I set Exception Settings to "Break when this exception is throw:", it is ignored.
Is there a way to turn on stack tracing and log it somewhere?
When the exception is thrown it shows this at the top of the stack
0x3 in UIKit.UIFont._FromDescriptor at /Library/Frameworks/Xamarin.iOS.framework/Versions/22.214.171.124/src/Xamarin.iOS/UIKit/UIFont.g.cs:104,5 C#
I suspect there is a font issue with custom fonts. When I remove or misspell my custom fonts in info.plist, then the exception is not thrown.
When the exception is throw, the app continues and the fonts are clearly being used.
I have tried to manually load the fonts into UIKit. I am getting an ArgumentNullException on this statement
var f1 = CGFont.CreateWithFontName("Fonts/MyLayoutControlFonts.otf");
The otf file definitely exists in the Resources folder and is included as a Bundled Resource. (I also tried as an Embedded resource)