Skip to content

[Android] IllegalStateException: Unable to load font from rc_paywall_fonts cache (FontWeight=600) #1745

Description

@enestatli

Description

We're seeing fatal IllegalStateException: Unable to load font crashes on Android originating from RevenueCat's paywall UI. The error fires during Compose layout/measure when loading a downloaded OTF font from RC's cache directory.

The exception is uncaught and the app terminates. We've observed this in production via Sentry on react-native-purchases@9.15.1 / react-native-purchases-ui@9.15.1.

Stack trace (ProGuard-mapped, frames not symbolicated)

IllegalStateException: Unable to load font Font(file=/data/user/0/<app>/cache/rc_paywall_fonts/8ca61878210e82fbc279cb412ab67adb.otf, weight=FontWeight(weight=600), style=Normal)

Caused by: IllegalStateException: Could not load font
  at c (SourceFile:81)
  at h (SourceFile:8)
  ...
  at measure-3p2s80s (SourceFile:9)
  at u0 (SourceFile:41)
  at measure-3p2s80s (SourceFile:1)

The crash happens at measure time within Compose (measure-3p2s80s), so the paywall is mid-layout when the font fails to load.

Environment

Field Value
react-native-purchases 9.15.1
react-native-purchases-ui 9.15.1
react-native 0.81.5
Device Samsung SM-S721U (Galaxy S24)
OS Android 16 (BP2A.250605.031.A3.S721USQSBCZD1)
Distribution Play Store
Handled no (fatal)

What we expect

A downloaded paywall font that can't be loaded shouldn't take the app down. Either:

  1. The font load should be wrapped in a try/catch and fall back to the system font, or
  2. If the cached font file is corrupt, the SDK should redownload it before raising.

Questions

  1. Is this a known issue with a specific paywall template / font weight (we see weight=600)?
  2. Could the cached file at cache/rc_paywall_fonts/<hash>.otf be partially written / corrupt under low-storage or interrupted-download conditions?
  3. Any guidance for users currently on 9.15.1 — clear cache, downgrade, etc.?

Happy to provide more Sentry breadcrumbs / exact paywall template ID if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions