-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'getConstants' of null, #204
Comments
Did you install the package (and link) and rebuild the app and cleaned build caches first if needed? |
Yes I took this exact steps |
To reproduce: npx react-native init RNBU204 --version="0.70.6"
cd RNBU204
npm i --save react-native-blob-util
echo "import RNFetchBlob from 'react-native-blob-util';" >> App.js
npm run ios The Metro window shows the following errors:
For iOS, the "fix" is to run cd ios; pod install; cd ..
npm run ios This probably should be documented somewhere, since the current documentation strongly suggests |
@SheetJSDev I'm going to try out your suggestions. Although I no longer need this package as I found another solution |
What solution you found as I am getting the exact error when I tried this package |
For iOS, the "fix" is to run cd ios; pod install; cd ..
npm run ios |
For android is there any solution?? |
Our React Native + RNBU demo (https://docs.sheetjs.com/docs/demos/mobile/reactnative#demo select "RNBU" in step 4) builds and runs in the simulator for Android 12 (S) Platform 31 Pixel 5. This works in RN 0.70.6 + RNBU 0.17.1 and in RN 0.70.4 + RN 0.17.0 (the versions used by @dekunleroy). Can you test if the same issue shows up in a new project? Try: npx react-native init RNBU204 --version="0.70.4"
cd RNBU204
npm i --save react-native-blob-util@0.17.0
echo "import RNFetchBlob from 'react-native-blob-util';" >> App.js
npm run android |
Issue can be reproduced in Expo Snack (both iOS and Android). expo/snack#385 tracking issue. |
Yeah but this is expo. I'm using native code and as far as I know am not part of the Expo SDK... So it won' work. |
Expo Snack issue was raised when trying to make our react native demo work with the snack. It happened to have the same message but This issue is reproducible locally on iOS using the first snippet from an up-thread comment #204 (comment) : npx react-native init RNBU204 --version="0.70.6"
cd RNBU204
npm i --save react-native-blob-util
echo "import RNFetchBlob from 'react-native-blob-util';" >> App.js
npm run ios Tested on iPhone 14 (iOS 16.2), the error is
The project issue is resolved by running cd ios; pod install; cd ..
npm run ios It's hard to tell if this is a bug in RNBU or merely an oversight in the docs. The Installation section of the docs does not mention the |
I would add the pod install to the docs. It makes sense that a pod install might be required. |
if you face this issue when trying to test your code , put this code in
if you don't have the
now you can add any general mock like i mentioned at the beginning or test functions inside it to be applied on all your test cases. |
Same issue here when I'm trying to start the APP. Thanks |
Same issue |
I tried adding mock code into setup file.
My apps works totally fine but facing this issue while testing with Jest |
I have the same issue with Android. Any solutions? |
same issue |
I was seeing this when running tests with jest. export default jest.fn(); Which covered off tests which weren't actually touching react-native-blob-util. jest.mock("react-native-blob-util", () => ({
android: {
actionViewIntent: jest.fn(),
},
ios: {
openDocument: jest.fn(),
previewDocument: jest.fn(),
},
config: jest.fn(),
fs: {
dirs: {
DocumentDir: "yourdocumentdir",
DownloadDir: "yourdownloadsdir",
},
},
})); |
same issue |
The following worked for me:
P.S. I faced this error only while running jest. |
worked for me! it was the issue of the version |
Same issue with Android |
Anyone have any fix for Android?? |
Same here |
1 similar comment
Same here |
In my case, I got these errors trying to use this with Expo Go, instead, you have to use an Expo Development build. You can create a dev build, sideload it onto your emulator / test device, and have it grab the latest js bundle automatically (just like expo go), by running |
not working with expo SDK 49 with expo go. |
It will not work with Expo Go, you need to use Expo Development Builds. |
what do file do i put this information at ? |
You can put this in the Then update your
|
the hope this could help you. |
Same issue on Android. "react-native-blob-util": "0.19.4" and "react-native": "0.72.10", |
I'm using expo, getting same error " TypeError: Cannot read property 'getConstants' of null, js engine: hermes ",... even after building the app, It's throwing error and react-native-pad is not loading uri |
Same issue here. I am using Expo 51. On iOS Development Build it works perfectly, however on Android it just crashes with this error. |
Same issue on Android development build. Any solution? |
can anyone please provide the accurate solution to this ? react-native-blob-util is giving this error |
Same here |
Hi, I am trying to convert an image url prefixed with https:// into base64 string using the react-native-blob-util, however I got this error after installing and also doing a pod install
react-native-blob-util Version: 0.17.0
RN Version: 0.70.4
The text was updated successfully, but these errors were encountered: