Question

setupPurchases of null on react native / expo

  • 31 August 2023
  • 8 replies
  • 812 views

Badge +1

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.
 


8 replies

Userlevel 4
Badge +8

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?

Badge +4

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

Badge +1

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.

Badge +1

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

Badge +1

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

Badge +1

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

Reply