react-native-pdf
react-native-pdf copied to clipboard
TypeError: null is not an object (evaluating 'ReactNativeBlobUtil.DocumentDir')
Followed the installation directions. yarn add react-native-pdf react-native-blob-util fbjs
Using: "react-native": "0.63.4", "react-native-pdf": "^6.4.0", "react-native-blob-util": "^0.13.18", "fbjs": "^3.0.2"
Getting this error: TypeError: null is not an object (evaluating 'ReactNativeBlobUtil.DocumentDir')
I'm having the same issue
I'm having the same problem and it seems to be with react-native-blob-util, nothing I've tried to do to fix it has worked so far.
Did you solve this error?
downgrading version to 0.13.7 and reinstalling with pod install seemed to work
I will try that. Thanks!
On Tue, Jan 11, 2022, at 4:58 PM, Pete Stenger wrote:
downgrading version to
0.13.7and reinstalling withpod installseemed to work— Reply to this email directly, view it on GitHub https://github.com/wonday/react-native-pdf/issues/624#issuecomment-1010395099, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAESF4N3XNBTO3NSGB2SMGLUVSRXXANCNFSM5LHU5HWQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>
I changed R-N-pdf to 6.3.0, and use rn-fetch-blob 0.12.0 instead react-native-blob-util, Its working fine now.
Same issue here, npm throw an error : version 0.12.0 doesnt exist :/
Nothing helps for me from suggested solutions plus expo.
Also: https://stackoverflow.com/questions/59694623/null-is-not-an-object-evaluating-rnfetchblob-documentdir-using-expo
rn-fetch-blob implements native code, and so it cannot be used in expo based projects. You would need to eject from expo
I still face the issue and open an issue here: https://github.com/RonRadtke/react-native-blob-util/issues/157 I am not using expo and using: "react-native": "0.68.1", "react-native-blob-util": "^0.16.0",
downgrading version to
0.13.7and reinstalling withpod installseemed to work
This give me the following error:
error: Error: Unable to resolve module ./mediacollection from /Users/lmasneri/Documents/veolia-et-moi-mobile/node_modules/react-native-blob-util/index.js:
None of these files exist:
* node_modules/react-native-blob-util/mediacollection(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
* node_modules/react-native-blob-util/mediacollection/index(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
I wonder, why this issue is not visible in the example app?
Also getting the same error. Any news on this?
also getting the same error in my app
I had this error on Android and what fixed it for me was downgrading the Android Gradle plugin to v7.0.4. It might have been something else as I'm not very confortable with this native stuff.
I updated the Gradle plugin line in the buildscript dependencies object (in /android/build.gradle) to: classpath('com.android.tools.build:gradle:7.0.4')
Android I'm not sure what's relevant so here's what I'm using:
- Build tools 31.0.0 (android/build.gradle):
buildToolsVersion = "31.0.0" - Gradle v7.3.3 (android/gradle/wrapper/gradle-wrapper.properties):
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
NPM packages I'm using some Expo modules in a bare React Native app
- react 17.0.2
- react-native 0.68.2
- react-native-blob-util 0.16.0
- react-native-pdf 6.5.0
In my case, react native PDF 6.5.0 and ract-native-blob-util 0.16.0 fixes the issue. I had to manually link the blob-util because of an issue with the run-android FYI.
Hey together,
when using Expo it's important that you use the Expo Dev Client as adding native code is supported since that feature. Basically, your own version of Expo Go is being created - freeing you from its technical limits.
Useful links:
- https://github.com/expo/config-plugins/tree/main/packages/react-native-pdf
- https://docs.expo.io/workflow/customizing/
- https://github.com/expo/examples/tree/master/with-pdf
Same issue found in expo SDK 49 "react-native-pdf": "^6.6.2", "react-native-blob-util": "^0.13.18"