Skip to main content
Question

TypeError: Cannot read property 'setupPurchases' of null


Forum|alt.badge.img

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

2 replies

Forum|alt.badge.img+8
  • RevenueCat Staff
  • 556 replies
  • April 17, 2025

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.


Forum|alt.badge.img

After I rebuilt my project for android , the issue was automatically resolved.


Reply


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