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

TypeError: null is not an object (evaluating 'ReactNativeBlobUtil.DocumentDir')

Open davidfeldt opened this issue 3 years ago • 17 comments

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')

davidfeldt avatar Jan 04 '22 15:01 davidfeldt

I'm having the same issue

markoprodanovic avatar Jan 06 '22 00:01 markoprodanovic

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.

yousefamar avatar Jan 09 '22 01:01 yousefamar

Did you solve this error?

hoanghuuf17 avatar Jan 11 '22 02:01 hoanghuuf17

downgrading version to 0.13.7 and reinstalling with pod install seemed to work

reteps avatar Jan 11 '22 21:01 reteps

I will try that. Thanks!

On Tue, Jan 11, 2022, at 4:58 PM, Pete Stenger wrote:

downgrading version to 0.13.7 and reinstalling with pod install seemed 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: @.***>

davidfeldt avatar Jan 12 '22 02:01 davidfeldt

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.

hoanghuuf17 avatar Jan 12 '22 02:01 hoanghuuf17

Same issue here, npm throw an error : version 0.12.0 doesnt exist :/

renishv8 avatar Feb 09 '22 12:02 renishv8

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

ikiK-CRO avatar Feb 11 '22 14:02 ikiK-CRO

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",

loupmasneri avatar May 17 '22 12:05 loupmasneri

downgrading version to 0.13.7 and reinstalling with pod install seemed 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)

loupmasneri avatar May 17 '22 13:05 loupmasneri

I wonder, why this issue is not visible in the example app?

pke avatar May 24 '22 14:05 pke

Also getting the same error. Any news on this?

alexandre-pedroza-h65 avatar Jun 02 '22 00:06 alexandre-pedroza-h65

also getting the same error in my app

visharma14 avatar Jun 02 '22 05:06 visharma14

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

Florent-Halm avatar Jun 03 '22 07:06 Florent-Halm

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.

sfratini avatar Jun 28 '22 10:06 sfratini

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

403access avatar Dec 30 '22 10:12 403access

Same issue found in expo SDK 49 "react-native-pdf": "^6.6.2", "react-native-blob-util": "^0.13.18"

kirtikapadiya avatar Jan 30 '24 08:01 kirtikapadiya