Unable to debug on device - UIFont.FromName returns null every time (problem with resources?)

I have an app that up until yesterday I was able to debug on a device, rather than just the iOS simulator, the problem I am having though is that now when I try and build the project on device it appears as though the resources are not being copied over to the device.

I am trying to set a custom font for a UILabel, but the call to UIFont.FromName returns null. I've tried this with several fonts, and from several differant calls to UIFont.FromName within the application, but each time a null object reference exception is thrown.

I've double checked that the resource is present and available when testing with the iOS Simulator, and that the fonts are set to BundleResource and AlwaysCopy, but still the problem persists.

Can any please advise as to why the call to UIFont.FromName returns null when trying to debug on a device, but is fine on the iOS simulator?

Best Answer


  • KeirLavelleKeirLavelle USMember

    An update on this; I've just tried a full re-install of Xamarin, with no effect. Could anyone please offer any assistance on this please?

  • ArturMalendowiczArturMalendowicz USMember ✭✭

    What if you change from BundleResource to Content?

  • KeirLavelleKeirLavelle USMember

    Thanks for getting back to me, I've tried that unfortunately it didn't solve the problem

  • KeirLavelleKeirLavelle USMember

    Changing the case of the folder that the fonts reside in, both on filesystem and in the info.plist rectified the problem - I have no idea why this suddenly became an issue though?

Sign In or Register to comment.