Invalid Resource Directory Name: obj/Debug/res/ fonts

I'm currently trying in change our fonts to be referenced as resources following the Xamarin Fonts Guide, but I'm seeing a weird issue where if i add my font and set the build action to 'AndroidResource', the build fails with the following error:
invalid resource directory name : error APT0000: obj/Debug/res/ fonts

The strange part is that the invalid file path has an extra space, but I don't know where its coming from. I've tried and recreated this with different directory names. I've also checked my csproj file in case the space was added there with no luck.

Has anyone else seen this issue or know a fix?


  • CharwakaCharwaka INMember ✭✭✭

    Hi @slajalin

    delete font folder and create folder in assets/fonts and clean Rebuild

  • slajalinslajalin USMember

    Hi @Charwaka , thanks for the suggestion. However, I want to build the font as an AndroidResource, not as an asset. I did try to add the font to assets/fonts folder but once I set the build action to AndroidResource, I get a
    invalid resource directory name : error APT0000: obj/Debug/res/ assets

    I believe this is something strange with setting a build action to be AndroidResource for a font.

  • LesterBotelloLesterBotello DOMember ✭✭

    Hey @slajalin! Did you manage to solve this? I'm getting the same, but a coworker is working with the exact same project in Windows and it compiles just fine. Are you by any chance working on VS for Mac?

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai

    We have a sample demonstrating a font as an AndroidResource:

    This is a fairly new feature as of Android 8.0(API 26) and Support Library v26 to include fonts as XML. Documentation available here:

    Do you perhaps have a project that you can upload to this post that is failing on your end?

  • slajalinslajalin USMember

    @LesterBotello Thanks for the headsup! Yes, my entire team is developing through VS for Mac which might be why we couldn't get ours to compile at all. We've pulled out our task to our backlog for now for us to revisit, but that's hardly a solution.

    @JohnDouglas Thanks for your reply. Yes, that's the tutorial i've been following, but could not get past pulling in the font. I cannot upload our actual project, but I've created a small sample app where I get the same error when trying to build the android app. I unfortunately can't post links yet with this account, but it's the only project i have on github on an account with the same name.

    It's interesting to see that this may be only a VS for Mac issue. Hope this helps and thank for your help!

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai


    Can you double check that your Build Tools version inside your Android SDK is >= 26.0.0? Can you also get me a Diagnostic Build Output?

  • slajalinslajalin USMember

    Unless there is a different Build Tools I need to look at, I checked and do have 26 installed in my instance of Visual Studio.
    Unfortunately, I can't show a screenshot, but It's in my Preferences -> Projects -> SDK Locations -> Android and there's a tab named 'Tools' where it lists all available versions of 'Android SDK Build Tools'.

    I've also attached my diagnostic logs.

Sign In or Register to comment.