Skip to main content

I do use Expo but when I try to initialize revenue cat SDK, I got ‘LOG {"error": :TypeError: Cannot read property 'setupPurchases' of null]}’ error.

my code just like that; await Purchases.configure({ apiKey: 'x' })

I’m  using andorid, in real device and emulator.
 

Hi, are you using a development build? Please see our guide here: 

 


Hi I have the same problem and I'm using the dev-client.
The error is in the catch of the setup() fonction that is calling the Purchases.configure


I do use Expo but when I try to initialize revenue cat SDK, I got ‘LOG {"error": :TypeError: Cannot read property 'setupPurchases' of null]}’ error.

my code just like that; await Purchases.configure({ apiKey: 'x' })

I’m  using andorid, in real device and emulator.
 

@onur-anil-mertoglu-271a59 have you fix the issue?


 I get the same error and I am running a dev build in my device (not expo go)


Did anybody found a way to fix this? I also get this error, I have a dev build installed and running. But In my root layout I have React Native Purchases and I get this problem. I have checked that env picks up well the api key, but don’t know why this happens.


facing the same issue , api key is fetched correctly but not sure what is causing this error  TypeError: Cannot read property 'setupPurchases' of null]” 
@ Revenue cart kindly provide your solution on this error


Has anyone figured  a work around for this issue , if yes then please do post it here 


It’s crazy, I’ve been stuck with this error for more than 2 weeks. Tried everything above, but had no luck.


I have the same issue. I am using the bare workflow and running the development build and still getting this error. Any resolution?


Has anyone found a solution to this?


still no solution to  LOG  gTypeError: Cannot read property 'setupPurchases' of null]?


Hi all,

Sorry for the delay here - can you share more logs or a screenshot of which line in your code the error happens in? Sounds like the Purchases object isn’t available in the code, so it might be an issue in the how the RevenueCat dependency was added. It might be worth deleting node_modules and npx installing everything again?


i was also facing same error problem is here :  const offerings = await Purchases.getOfferings();

i have even installed it newliy then also its not working


Reply