Hope someone can help me debug this. (System.ArgumentNullException)

SolomonFriedSolomonFried USMember ✭✭
edited June 2018 in Xamarin.iOS

I have an application that runs in UWP, Android & iOS.
I have added a custom font to the application and included it in info.plist.

The app runs fine in UWP and Android.
When I run the application in iOS, I get the following error in AppDelegate.cs when calling base.FinishedLaunching

Exception:

System.ArgumentNullException: Value cannot be null.
Parameter name: descriptor occurred

The app still launches, and I can see the fonts that are being used.
If all I do is edit the info.plist to remove the font reference, or just misspell it so that it is not found, then the exception is not thrown. The app still runs but there a "?"s where my font symbols should have been.

I have not been able to reproduce this in a skeletal application, so the problem must be somewhere in m code.

I cannot get VS2017 to break on ArgumentNullException (It basically ignores the exception settings when running an iOS emulator)

Is there a log somewhere that would contain the exception details?
Is there an option to emit a trace?

Any help is appreciated.

Best Answer

  • SolomonFriedSolomonFried US ✭✭
    Accepted Answer

    Update:
    After a week if tracking down an ArgumentNullException in my app that I suspected was related to my custom fonts,
    I finally found that the Button containing the font had a Style with a FontAttribute set to BOLD.
    I removed that attribute and the exception is no longer being thrown.

    Not sure if this is an iOS or Xamarin issue. The app works fine on UWP and Android.

Answers

  • SolomonFriedSolomonFried USMember ✭✭
    Accepted Answer

    Update:
    After a week if tracking down an ArgumentNullException in my app that I suspected was related to my custom fonts,
    I finally found that the Button containing the font had a Style with a FontAttribute set to BOLD.
    I removed that attribute and the exception is no longer being thrown.

    Not sure if this is an iOS or Xamarin issue. The app works fine on UWP and Android.

Sign In or Register to comment.