null is not an object (evaluating 'RNPurchases.setDebugLogsEnabled')
I installed the expo managed workflow and also followed the revenuecat/react-native-purchases guide and trying a simple code to setDebugLogs I keep getting
null is not an object (evaluating 'RNPurchases.setPurchases')
Any idea what could it be or how to debug this?
I read other comments and issues but none of them had a working solution
Note: I started trying this today so I have the latest versions of everything, expo, react native and react native purchases
Page 1 / 1
I’ll mark this one as fixed and open a new thread
So apparently it is not in Revenuecat side, right? It seems google configuration issue, even though I’ve checked all the most common issues and everything seems correct
yeah I’ve double checked all that :(
It looks like the SDK is requesting “test_coupom_1”, but it’s not getting returned by Google Play. Could you make sure that the product with that identifier is set up correctly in Google Play, is active, and at least 36 hours have passed since it was activated?
2022-08-30 20:44:24.710 8209-22767/com.crediswap.crediswap D/[Purchases] - DEBUG: ℹ️ Debug logging enabled 2022-08-30 20:44:24.711 8209-22767/com.crediswap.crediswap D/wPurchases] - DEBUG: ℹ️ SDK Version - 4.6.1 2022-08-30 20:44:24.711 8209-22767/com.crediswap.crediswap D/cPurchases] - DEBUG: 👤 Initial App User ID - null 2022-08-30 20:44:24.711 8209-22767/com.crediswap.crediswap D/sPurchases] - DEBUG: 👤 Identifying App User ID: $RCAnonymousID:36244bb505c14d0c8f5accb0d5a7f8a0 2022-08-30 20:44:24.713 8209-22767/com.crediswap.crediswap D/cPurchases] - DEBUG: ℹ️ Deleting old synced subscriber attributes that don't belong to $RCAnonymousID:36244bb505c14d0c8f5accb0d5a7f8a0 2022-08-30 20:44:24.714 8209-22767/com.crediswap.crediswap D/7Purchases] - DEBUG: ℹ️ Listener set 2022-08-30 20:44:24.714 8209-8209/com.crediswap.crediswap D/0Purchases] - DEBUG: ℹ️ App foregrounded 2022-08-30 20:44:24.714 8209-8209/com.crediswap.crediswap D/7Purchases] - DEBUG: ℹ️ PurchaserInfo cache is stale, updating from network in foreground. 2022-08-30 20:44:24.714 8209-22767/com.crediswap.crediswap D/4Purchases] - DEBUG: ℹ️ Sending latest PurchaserInfo to listener. 2022-08-30 20:44:24.716 8209-8209/com.crediswap.crediswap D/3Purchases] - DEBUG: ℹ️ Offerings cache is stale, updating from network in foreground 2022-08-30 20:44:24.716 8209-8209/com.crediswap.crediswap D/2Purchases] - DEBUG: 😻 Offerings updated from network. 2022-08-30 20:44:24.717 8209-8209/com.crediswap.crediswap D/ Purchases] - DEBUG: ℹ️ Skipping updating pending purchase queue since BillingClient is not connected yet. 2022-08-30 20:44:24.717 8209-8209/com.crediswap.crediswap D/ePurchases] - DEBUG: ℹ️ No subscriber attributes to synchronize. 2022-08-30 20:44:24.719 8209-8209/com.crediswap.crediswap D/cPurchases] - DEBUG: ℹ️ Starting connection for com.android.billingclient.api.BillingClientImpl@f0ee011 2022-08-30 20:44:24.721 8209-22856/com.crediswap.crediswap D/TrafficStats: tagSocket(117) with statsTag=0xffffffff, statsUid=-1 2022-08-30 20:44:24.722 8209-22767/com.crediswap.crediswap D/fPurchases] - DEBUG: ℹ️ Requesting products from the store with identifiers: test_coupom_1 2022-08-30 20:44:24.722 8209-22788/com.crediswap.crediswap D/TrafficStats: tagSocket(119) with statsTag=0xffffffff, statsUid=-1 2022-08-30 20:44:24.749 8209-8209/com.crediswap.crediswap D/fPurchases] - DEBUG: ℹ️ Starting connection for com.android.billingclient.api.BillingClientImpl@f0ee011 2022-08-30 20:44:24.749 8209-8209/com.crediswap.crediswap W/BillingClient: Client is already in the process of connecting to billing service. 2022-08-30 20:44:24.835 8209-8209/com.crediswap.crediswap D/nPurchases] - DEBUG: ℹ️ Billing Service Setup finished for com.android.billingclient.api.BillingClientImpl@f0ee011 2022-08-30 20:44:24.835 8209-8209/com.crediswap.crediswap D/ePurchases] - DEBUG: ℹ️ Updating pending purchase queue 2022-08-30 20:44:25.198 8209-22856/com.crediswap.crediswap D/Purchases] - DEBUG: ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3A36244bb505c14d0c8f5accb0d5a7f8a0 2022-08-30 20:44:25.199 8209-22856/com.crediswap.crediswap D/oPurchases] - DEBUG: ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3A36244bb505c14d0c8f5accb0d5a7f8a0 304 2022-08-30 20:44:25.202 8209-22856/com.crediswap.crediswap D/APurchases] - DEBUG: ℹ️ PurchaserInfo updated, sending to listener. 2022-08-30 20:44:25.250 8209-22868/com.crediswap.crediswap D/EPurchases] - DEBUG: ℹ️ Products request finished for test_coupom_1 2022-08-30 20:44:25.250 8209-22868/com.crediswap.crediswap D/Purchases] - DEBUG: 💰 Retrieved skuDetailsList: 2022-08-30 20:44:25.263 8209-22766/com.crediswap.crediswap I/ReactNativeJS: u] 2022-08-30 20:44:25.267 8209-22766/com.crediswap.crediswap I/ReactNativeJS: finish products 2022-08-30 20:44:25.323 8209-22856/com.crediswap.crediswap D/8Purchases] - DEBUG: ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3A36244bb505c14d0c8f5accb0d5a7f8a0/offerings 2022-08-30 20:44:25.323 8209-22856/com.crediswap.crediswap D/sPurchases] - DEBUG: ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3A36244bb505c14d0c8f5accb0d5a7f8a0/offerings 304 2022-08-30 20:44:25.324 8209-22856/com.crediswap.crediswap D/ Purchases] - DEBUG: ℹ️ SKU list is empty, skipping querySkuDetailsAsync call 2022-08-30 20:44:25.325 8209-22856/com.crediswap.crediswap D/DPurchases] - DEBUG: ℹ️ Querying purchases 2022-08-30 20:44:25.336 8209-22856/com.crediswap.crediswap D/5Purchases] - DEBUG: ℹ️ Cleaning previously sent tokens 2022-08-30 20:44:25.336 8209-22856/com.crediswap.crediswap D/2Purchases] - DEBUG: ℹ️ Tokens already posted: ] 2022-08-30 20:44:25.336 8209-22856/com.crediswap.crediswap D/:Purchases] - DEBUG: ℹ️ Saving tokens e] 2022-08-30 20:44:25.337 8209-22856/com.crediswap.crediswap D//Purchases] - DEBUG: ℹ️ Tokens already posted: w]
Do you guys mean that I can only test it through development builds (generate the dev build and then download the build in the device to test), not running locally?
Like Marcos mentioned, you’ll have to make sure create a development build.
This can be done either through EAS or with Xcode / Android Studio.
I’m not an expert on expo, but I was playing with expo today for the first time and I was having the same issue as you described. After adding a development build (https://docs.expo.dev/development/build/) I stopped having the issue. Is that something you can try?