react-native-fetch-blob
react-native-fetch-blob copied to clipboard
Undefined is not an object(evaluating 'RNFetchBlob.DocumentDir')
Hi, can you help me about this error.
"react": "16.0.0", "react-native": "0.50.4",

same issue here.
"react": "16.3.0-alpha.1", "react-native": "0.54.3",
UPDATE: solved by correctly adding the package on native side, because react-native link have not done it correctly.
@quarkcore I follow this document but still error.
https://github.com/wkh237/react-native-fetch-blob/wiki/Manually-Link-Package#user-content-link-ios-package
@safeimuslim
i use the application implementation of react-native-navigation where it has another method to register native modules.
espacially i have no idea about ios on native because im comming from the android world..
i only found out that the error is normaly caused if not registered on native properly.
This is kind of crazy, I've rarely see so many duplicate issues...
Duplicate issues with potential solutions https://github.com/wkh237/react-native-fetch-blob/issues/627 https://github.com/wkh237/react-native-fetch-blob/issues/251 (for me this comment helped, if using cocoapods, "be sure to run pod install after linking": https://github.com/wkh237/react-native-fetch-blob/issues/251#issuecomment-387649022) https://github.com/wkh237/react-native-fetch-blob/issues/454 https://github.com/wkh237/react-native-fetch-blob/issues/386 https://github.com/wkh237/react-native-fetch-blob/issues/371 https://github.com/wkh237/react-native-fetch-blob/issues/350 https://github.com/wkh237/react-native-fetch-blob/issues/84 https://github.com/wkh237/react-native-fetch-blob/issues/51 https://github.com/wkh237/react-native-fetch-blob/issues/30
Duplicates without much info: https://github.com/wkh237/react-native-fetch-blob/issues/594 https://github.com/wkh237/react-native-fetch-blob/issues/383
npm install && react-native link worked for me!
npm install && react-native link not worked for me. Any other solution
Hello i have solved this issue for iOS---- when you install the react-native-fetch-blob and link with iOS, it only provide limited lib on native side.
you can to open project from iOS in Xcode then remove the library of RNFetchBlob.xcodeproj from library folder and then again add by right click on library folder from node modules-->react-native-fetch-blob--->iOS folder --->add project RNFetchBlob.xcodeproj then all required file will be there and make sure add lib on build phases also libRNFetchBlob.a
it works for me.
Thanks
not work for me in windows
npm link or manual configuration both not working for me
me too cannot make this work
{
"name": "my-new-project",
"main": "node_modules/expo/AppEntry.js",
"private": true,
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/samples": "2.1.1",
"expo": "^30.0.1",
"moment": "^2.23.0",
"react": "16.3.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
"react-native-elements": "^0.19.1",
"react-native-email": "^1.0.2",
"react-native-fetch-blob": "^0.10.8",
"react-native-image-picker": "^0.28.0",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-responsive-screen": "^1.2.0",
"react-native-router-flux": "^4.0.6",
"react-native-select-input-ios": "^2.0.1",
"react-navigation": "^2.18.3",
"rn-fetch-blob": "^0.10.15"
},
"devDependencies": {
"jest-expo": "32.0.0"
}
}
The error I get:

same issue here.
"react": "16.3.0-alpha.1", "react-native": "0.54.3",
UPDATE: solved by correctly adding the package on native side, because react-native link have not done it correctly.
HOw did you do it exactly? Do you recall? What do you mean adding package on native side??
Solved it for my self by doing
npm install react-native-fetch-blob
react-native link
then manually adding libRNFetchBlob.a to "Link Binary with Libraries"