undefined is not a function (evaluating stripe module.init(options)
See original GitHub issueThe problem
When I try to set up Stripe for my app, I’m getting the following error: undefined is not a function (evaluating stripe module.init(options)
I believe it is a linking issue, but when I try to run react-native link tipsi-stripe, I get a SPAWN UNKNOWN error. I am developing this app on Expo but running it on an Android device, so I followed the instructions here https://tipsi.github.io/tipsi-stripe/docs/linking.html for manually linking for Android. I’m using a Windows computer and so don’t have Xcode.
Also, I’ve read that you need to detach the project from Expo in order to utilize Apple Pay, but at this point we are just trying to do payments through cards and would love to not have to detach. If it is not possible to use tipsi-stripe with Expo without having to detach, I’d love to hear any alternatives!
Please let me know if you want any more information about the issue!
Environment
tipsi-stripe
version: 5.4.0- Last
tipsi-stripe
version where the issue was not reproduced (if applicable): - iOS or Android: Android
- OS version: Windows 10
- React-Native version: 0.55.4
- (Android only)
com.google.firebase:firebase-core
version: - (Android only)
com.google.android.gms:play-services-base
version:
For Android
, please provide the following sections from android/app/build.gradle
:
- android.compileSdkVersion: 23
- android.buildToolsVersion: 23.0.1
- android.defaultConfig.minSdkVersion: 16
- android.defaultConfig.targetSdkVersion: 22
- android.defaultConfig.multiDexEnabled (if exists)
Screenshots, GIFs
Code To Reproduce Issue
stripe.setOptions({ publishableKey: ‘pk_test_7Hatfb7bdJuKHTHwdusk2R1L’, androidPayMode: ‘test’, });
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (2 by maintainers)
Top GitHub Comments
I have same issue with IOS
@MRHuezo Hi … I was having the same problem … what I did was create a little new project where I only use (expo-payments-stripe) … Once you create the project, run it with Xcode until it compiles successfully and runs in the simulator. (In the version of Xcode that I am using, it only runs correctly in the iphone 8 simulator in the others it gives me problems) … then from a code editor install (expo-payments-stripe) and follow the steps in the documentation of Expo.io or help from the (tipsi-stripe (automatic)). then you stop the compilation in Xcode and run it again … it should work for you … that problem is due to the link of the modules that it seems that only Xcode is capable of doing it in the case of IOS. Try it and let me know if it worked for you. note: it only works for me if I run it from Xcode … if it works differently for someone … let me know …