Skip to main content

Error Description:
TypeError: Cannot read property 'setupPurchases' of null

Environment Details:


- Platform: React Native (Expo)
- react-native-purchases version: 8.9.4
- React Native version: 0.76.9
- Expo version: ~52.0.42
- OS: Android
- Build type: Development

 

Error Context:
- Error occurs during RevenueCat SDK initialization
- Android Manifest includes the billing permission (com.android.vending.BILLING)
- Using Expo managed workflow with dev client (expo-dev-client ~5.0.19)

Steps to Reproduce:
1. Initialize RevenueCat SDK in app startup
2. Error occurs immediately during the Purchases.configure() call
3. The native module appears to be null when the app tries to access it

Additional Information:
- The app is using Expo Router for navigation
- RevenueCat configuration is attempted in the app root component
- Billing permission is correctly declared in AndroidManifest.xml
- Project is using the latest stable version of react-native-purchases

Attempted Solutions:
1. Verified billing permission in AndroidManifest.xml
2. Confirmed RevenueCat SDK is properly imported
3. Tried dynamic imports for the RevenueCat module
4. App is properly configured with dev client

Hi, I replied to your ticket internally on this recommending the following:

  • Try deleting node_modules and npx and installing it all again to see if this fixes the issue. You can follow our react-native installation guide to double-check that all steps are followed here.
  • If this does not fix it, then please provide RevenueCat debug logs, a stack trace, and the code you are using

Let us continue working on this via your ticket to keep all discussion in one place and I can then update here later with the solution.


Reply