Skip to content
← Back to activity

Solution skill

[Android 14] Crash Exception - RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED is required

Version 2Sign in to save

Complete solution

Fixes the Android 14 crash 'One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified' by upgrading React Native Purchases to 6.2.1 or newer. Use when your app crashes on Android 14 after targeting SDK 34. Not for crashes on older Android versions, or for receivers you register in your own code.

Fix first: upgrade React Native Purchases to 6.2.1 or newer. Android 14 requires RECEIVEREXPORTED or RECEIVERNOT_EXPORTED when registering a broadcast receiver, and the SDK fixed it at 6.2.1.

Fatal Exception: java.lang.SecurityException: com.my-test-app.app:
One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified
when a receiver isn't being registered exclusively for system broadcasts
  1. Upgrade react-native-purchases to 6.2.1 or newer.
  2. Ship it and watch crash reports. Expected: the SecurityException crashes stop on Android 14 devices.

When to use: your crash reporter shows this SecurityException on Android 14 after you updated your target SDK to 34.

When not to use: crashes on Android 13 and below, or broadcast receivers registered in your own native code (that flag is yours to add, not the SDK's).

Compatibility: React Native Purchases 6.2.1+, Android 14 (SDK 34).

Variants:

  • "RECEIVER_EXPORTED React Native Purchases"
  • "android 14 purchases crash SecurityException"
  • "one of RECEIVEREXPORTED or RECEIVERNOT_EXPORTED should be specified react native"

Root cause: Android 14 made the exported flag mandatory for broadcast receivers, and the older Purchases SDK registered receivers without it.

Edge cases: if you register your own receivers in native code, you need to add the flag there yourself. The SDK upgrade only fixes the SDK's own receivers.

Evidence

In gh:RevenueCat/react-native-purchases#670 (https://github.com/RevenueCat/react-native-purchases/issues/670), the reporter ran into this: Hello everyone! Since last week, we updated our android sdk to 34, to support Android 14, and we are getting some crashes on firebase: Fatal Exception: java.lang.SecurityException: com.my-test-app.app: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) at android.os.Parcel.createException(Parcel.java:3041) at android.os.Parcel.readException(Parcel.java:3024) at android.os.Parcel.readException(Parcel.java:2966) at... The verified resolution: Upgrade React Native Purchases to 6.2.1 or newer. Android 14 requires RECEIVEREXPORTED or RECEIVERNOT_EXPORTED` when registering a broadcast receiver, and the crash was fixed in the SDK at 6.2.1. If you target SDK 34 / Android 14, staying on an older Purchases version keeps crashing; updating is the fix.

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_XlWGaPKQJ05lXoBdsiTHUQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">[Android 14] Crash Exception - RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED is required <span>— Vectle</span></a>

[Android 14] Crash Exception - RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED is required | Vectle