Expo Go Stripe: Native module cannot be null - javascript

I believe Expo-Go can now support Stripe payments (based off the updated docs provided here.)
I am using Expo SDK Version 40.
I perform
"expo install # stripe/stripe-react-native"
to ensure I'm getting the correct version.
Then I attempt to import Stripe into my project using:
import { StripeProvider } from '#stripe/stripe-react-native'
As soon as the project refreshes, the app crashes and throws ~25 errors/warnings, most commonly the "Native module cannot be null" error
Has anyone else encountered this error?

I am using Expo SDK Version 40.
You have to use a higher version like 41/42, I believe, so I'd try updating that. Per the link you shared, you'll note that https://docs.expo.dev/versions/v41.0.0/sdk/stripe/ exists but https://docs.expo.dev/versions/v40.0.0/sdk/stripe/ doesn't for instance.
https://github.com/stripe/stripe-react-native/issues/467#issuecomment-889217595
https://github.com/stripe/stripe-react-native/issues/256#issuecomment-846922117

Related

How to use PocketBase in React

I am currently learning React and wanted to use PocketBase in my app. I installed PocketBase via npm i pocketbase --save yet when I try and run my React app, I get this message,
Cannot find module 'pocketbase' or its corresponding type declarations.
> 1 | import PocketBase from 'pocketbase'
| ^^^^^^^^^^^^
I have tried searching but the only thing I can find is deprecated. If anyone know how to do this, that would be great!
Looks like it may just lag from your IDE. I am getting the same thing but my app is not breaking and I also have installed pocketbase. Once I create an instance though it started working- I believe because VSCode refreshed after it had to try to fetch the type definitions.
After VScode fetches type definitions

Unsupported Version of Play billing

i am using react-native-billing library with version 3.0.0. I am facing an issue i.e, when we roll out the APK for production, after upload we are getting this error message :
"We've detected this app uses an unsupported version of Play billing. Please upgrade to Billing Library version 3 or newer to publish this app"
PROBLEM:-
I have manually added the following line in
android/app/build.gradle ->implementation project(':react-native-billing')
android/build.gradle -> minSdkVersion = 16,compileSdkVersion = 28,targetSdkVersion = 30
with these following details, the application is working fine but google refuses to upload our build with this error:-
"We've detected this app uses an unsupported version of Play billing. Please upgrade to Billing Library version 3 or newer to publish this app"
SOLUTION WE TRIED:-
added the following line in android/app/build.gradle
implementation "com.android.billingclient:billing:3.0.0"
using Android API 30
With these changes, the build was successfully uploaded but we are not getting a product list from "In-app products".
And after adding this line in debugging mode the application was crashing on this line.
InAppBilling.open();
We are importing InAppBilling from the "react-native-billing" library.
Any help will be highly appreciated.
Ran into the same issue - it looks like the plugin react-native-billing was built off of another plugin (https://github.com/anjlab/android-inapp-billing-v3) when Billing Library version 2 was the standard. Plugin android-inapp-billing-v3 has since updated to Billing Library 3 but react-native-billing has not implemented the required changes to match up. I've been able to force react-native-billing to pull the newer version of android-inapp-billing-v3 and am attempting to update the plugin manually (so far unsuccessfully) but if better heads want to give it a crack:
in
~\node_modules\react-native-billing\android\build.gradle
update:
dependencies {
...
implementation "com.anjlab.android.iab.v3:library:${safeExtGet('anjlabIABVersion', '2.0.3')}"
}
then follow this migration guide:
https://github.com/anjlab/android-inapp-billing-v3/blob/master/UPGRADING.md

React : Invalid hooks call without changing the React code

I am working on a full-stack app. My front-end, built on React was working fine. I installed cors for my back-end and it suddenly started giving me Invalid hook call error in my react app.
I tried uninstalling the dependency and also reverting to 2 old commits but it didn't work. I'm thinking it might be because of a peer dependency causing multiple versions of React. I tried npm ls react and npm ls react-dom but I have only one version for each i.e. 17.0.2.
The error message is also not helpful as I cannot understand where to start digging from. Attaching it below.
Here's the code repo (I couldn't figure out which part of code to share). The React code is inside the client directory. If someone can pinpoint me where to look or help me with the issue I'll be obliged. Thanks!
Error message

Error importing npm module in react-native

Currently creating an android app. I am simply trying to import the spotify-web-api-node module.
One line so far in my index.android.js to do this:
import SpotifyWebApi from 'spotify-web-api-node';
When I go to load the JS into my emulator I get the follow error:
602/603Error while persisting cache: SyntaxError /path/to/the/project/node_modules/restler/lib/multipartform.js: Invalid number (112:35)
I am using a mac, this occurs for android (have not tried ios yet).
react-native -v =
react-native-cli: 0.1.10
react-native: 0.21.0
Is this module surely not compatible with react-native or is there an edit I may need to make within restler to make it compatible? I see on the line it is complaining about, it is attempting to open/use the file system.
Line that is in the error description:
fs.open(this.value.path, "r", 0666, function (err, fd) {
First of all, I have never used this API. But after reading readme.md of spotify-web-api-node I found spotify-web-api-js
I assume you want to fire queries through spotify's API and display the results in your app. I'd suggest you to use spotify-web-api-js instead of spotify-web-api-node
You can call fetch() in your react-native app and use their API. Please let me know if this works. So that programmers who are facing the same problem will have an answer on this thread. Good luck!

Transformer hangs in recent versions of React Native when using Baobab

I started my React Native project with version 0.12.0 and Baobab. Everything worked great until React Native 0.14.2. In any version since then, the transform in the packager stops at 98% and the JS load fails.
I have used some of the advice in this github issue to determine that it's transforming a file in Baobab (baobab/dist/update.js or baobab/dist/watcher.js in different runs).
I have confirmed that Baobab is the issue by creating a clean React Native 0.16.0 install and only putting Baobab in it (with the required require)
At this stage, I'm not sure whether I should raise an issue with React Native or with Baobab, so I'm looking for advice on how to get some sort of error message that I can use to debug the issue and work out what's going wrong.
Ok. Worked this out myself:
By adding debug=babel to the environment the packager is running in, I got a huge amount of output and hidden in there was an error that .babelrc in the baobab package had an optional entry and the React Native packager doesn't understand optional. I deleted the .babelrc from the baobab package and everything works.

Categories

Resources