stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

TypeError: null is not an object (evaluating '_NativeStripeSdk.default.getConstants')

Open gaurav27ats opened this issue 3 years ago • 9 comments

Describe the bug I have this error when a build my project on ios simulator: TypeError: null is not an object (evaluating '_NativeStripeSdk.default.getConstants')

I tried to setup stripe-react-native on a new react-native project and it works without problem but not on mine.

To Reproduce Steps to reproduce the behavior:

  1. run the project on android
  2. getting errors in metro
  3. See error

Expected behavior To build without crashing

Screenshots image

Desktop (please complete the following information):

  • OS: Windows

Smartphone (please complete the following information):

  • Device: android
  • OS: android
  • Version 12
"@stripe/stripe-react-native": "^0.23.0",
 "react": "^16.0.0",
 "react-native": "^0.65.1",

Please help me to resolve this issue Thanks in advance 🙏🙏🙏

gaurav27ats avatar Jan 23 '23 11:01 gaurav27ats

Are you using Expo? This looks like the JS you're using doesn't match the native code that is expected. If you're not using Expo, I would try clearing gradle caches and rebuilding the app

charliecruzan-stripe avatar Jan 25 '23 18:01 charliecruzan-stripe

This is happening for me too on iOS. "@stripe/react-stripe-js": "^1.16.4", "@stripe/stripe-js": "^1.46.0", "@stripe/stripe-react-native": "^0.23.3", "expo": "~47.0.12",

ejkkan avatar Feb 08 '23 20:02 ejkkan

If you're using Expo SDK 47 you need to use v0.19.0 of this library: https://github.com/stripe/stripe-react-native/blob/master/CHANGELOG.md#0190---2022-09-16--expo-sdk-47. Please follow Expo's documentation here.

Also- @stripe/react-stripe-js and @stripe/stripe-js are not React Native compatible.

charliecruzan-stripe avatar Feb 08 '23 21:02 charliecruzan-stripe

Hi @charliecruzan-stripe, I am trying to setup @stripe/stripe-react-native but getting the same error. I have this configuration:

react-native: 0.61.3 (not using expo)
react: 16.11.0
@stripe/stripe-react-native: 0.24.0
-----------------------
minSdkVersion = 22
compileSdkVersion = 33
targetSdkVersion = 33

It builds successfully, then installs the apk, but gives this error when launching the app after bundling.

image

Any suggesstions?

mburakkalkan avatar Feb 22 '23 17:02 mburakkalkan

react-native: 0.61.3

as of v0.8.0, you need to use RN 64: https://github.com/stripe/stripe-react-native/blob/master/CHANGELOG.md#080---2022-04-27

charliecruzan-stripe avatar Feb 22 '23 19:02 charliecruzan-stripe

Hey @charliecruzan-stripe i have the same issue in ios simulator. even after RN is 64

dependencies: "@stripe/stripe-react-native": "^0.19.0",(not using expo) "react-native": "0.64.0", "react": "17.0.1"

ios deployment target: platform :ios, '12.0'

Kishore-D18 avatar Jun 13 '23 06:06 Kishore-D18

Hey @charliecruzan-stripe i have the same issue in ios simulator. even after RN is 64

dependencies: "@stripe/stripe-react-native": "^0.19.0",(not using expo) "react-native": "0.64.0", "react": "17.0.1"

ios deployment target: platform :ios, '12.0'

I get same issues, anyone can help?

khoand04 avatar Jan 18 '24 12:01 khoand04

Describe the bug I have this error when a build my project on ios simulator: TypeError: null is not an object (evaluating '_NativeStripeSdk.default.getConstants')

I tried to setup stripe-react-native on a new react-native project and it works without problem but not on mine.

To Reproduce Steps to reproduce the behavior:

run the project on android getting errors in metro See error

kalaanjali19 avatar Feb 05 '25 06:02 kalaanjali19

any updates on this?

viethung0823 avatar Mar 16 '25 15:03 viethung0823