Skip to main content
Question

Custom fonts + Expo + Paywall V2 + Android


Forum|alt.badge.img

Hi there,

I’m trying to get custom fonts working on a Paywall V2 within an Expo project. After following the RC instructions, things work fine on iOS - however I’m not sure what I’m supposed to do to get Android to use the custom fonts. On Android, my Paywall just defaults to a system font rather than the custom fonts (and all variants end up looking the same).

My Expo config is as follows:

Expo config

 

This creates the following structure my `android` folder when I build the project - which appears right (as in, the fonts are being copied and an xml file is being generated by expo-font):

Generated android folder structure from Expo

The generated XML file looks like this:

Generated xml_hind.xml file

 

I’ve also uploaded the fonts to the Paywall of course. However what I’m unsure about is what am I meant to set as my Android resource names in RC? I’ve tried a combo of various things, but none seem to work. In addition the “Learn more” text doesn’t actually link to anything in this dialogue - so wondering if the feature is still a WIP:

 

Help would be appreciated.

This post has been closed for comments

6 replies

Forum|alt.badge.img+3
  • RevenueCat Staff
  • 61 replies
  • July 2, 2025

Hi ​@db888, thanks for reaching out and sorry for the issues you’re finding.

Looking at your resulting android project, I believe the correct configuration should be to set the option to `Map to XML resource file`, and then for the name of the font, you should input `xml_hind`, which is the name of the resource the way android will find it. 

Can you confirm whether those settings work for you? If not, would you mind sharing some debug logs of your app when presenting a paywall? Also, would be great if you can confirm the version of the SDK you’re using.

Best

Toni


Forum|alt.badge.img
  • Author
  • New Member
  • 4 replies
  • July 2, 2025

Hi ​@toni-rico - thanks for your response.

I originally tried a number of variations, including `xml_hind` with `Map to XML resource file` like you suggested - but no combo seemed to work unfortunately.

But the good news is I have since managed to resolve this issue through further trial and error:

Solution: I basically had to remove the `fonts` array that was in my screenshot and explicitly create a `iOS` and `android` objects in my `expo-fonts` config. I have no idea why having a global `fonts` key was breaking Android fonts (only in RC paywalls; they still worked fine in my app), but making that change has resulted in custom fonts working as expected on Android. Using this config, it doesn’t matter what I enter as the `Android resource name` in the Paywall Builder UI - it seems to work regardless of what value I put in there (though I’m still not sure if there are side effects of not setting that properly?).

So feel free to mark this as resolved. That said,  think it’d be nice if you update your documentation to provide clarity on what to input within the `Set Android resource names` config (it’s far from clear ATM plus the `Learn more` button in the dialogue does nothing, as previously mentioned). Concrete examples in your docs showing how to configure various SDKs with custom fonts and what exact values to enter in this dialogue + how they are actually leveraged / how to check the values are properly assigned / side effects of misconfiguring them would make for much improved DX.


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 61 replies
  • July 2, 2025

Oh interesting! Glad that it worked for you and thanks for reaching back with that tip! Is it possible the generated android project now has the fonts in a different folder, like the `assets` folder? Or did you notice any other difference in how the fonts were setup? Mostly would like to understand why it wasn’t working before.

And thank you as well for your feedback! Ideally it should work out of the box, so we would like to debug the issue first but will definitely update the docs with the result.

 


Forum|alt.badge.img
  • Author
  • New Member
  • 4 replies
  • July 3, 2025

Is it possible the generated android project now has the fonts in a different folder, like the `assets` folder? Or did you notice any other difference in how the fonts were setup?

Good questions ​@toni-rico.

The underlying fonts still appear to be in the right place when using the global `fonts` key vs individual platform ones (eg the Android ones still end up at android/app/src/main/res/font in both scenarios). So I’m thinking it must be some kind of collision caused by using the global key rather than the platform key? Maybe Expo treates globally registered vs OS specific fonts separately or something - though that would be strange because the custom fonts worked everywhere else just fine when registered globally (it was just the RC paywall that would fall back the the system default).

Does the RC React Native SDK leverage expo-fonts’ useFonts hook, or does it try to find/load fonts some other way? If the former, then I’d expect it to work fine with the global key (since other screens use this method), but if not then I guess that’s the culprit.

Let me know if you have any additional thoughts. Happy to help tty and pinpoint this further.


Forum|alt.badge.img+3
  • RevenueCat Staff
  • 61 replies
  • July 3, 2025

Hmm interesting ​@db888… Paywalls actually use the native android way to reference fonts, as can be seen here. We also fallback to different locations where the fonts may be found just in case… It’s very strange it’s not able to find it in the res/font directory… I will keep digging, but thanks again for reporting this!


Forum|alt.badge.img
  • Author
  • New Member
  • 4 replies
  • July 4, 2025

No problem - thanks for committing time towards looking into this.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings