React Native Fetch Blob - undefined is not an object (evaluating 'RNFetchBlob.DocumentDir')

杀马特。学长 韩版系。学妹 提交于 2019-12-03 14:23:34

So it looks like the module isn't importing. Obvious I know, I can only think of a few things to help seeing as that project looks fairly popular and stable.

I noticed that you're requiring 'react-native-file-uploader' but using 'react-native-fetch-blob'. I'm assuming this is a mistake. You could also try, if you haven't:

var RNFetchBlob = require('react-native-fetch-blob')

Now assuming you're correctly importing it, try one of the following and then restart x-code:

  1. If you haven't already restart the packager. I recall having to restart the packager every time I installed a new module.

  2. If that doesn't work, try installing deleting it from your node modules (just to be safe) and installing with cocoa pods which will handle all of the linking for you.

After linking you need to run

pod update

inside ios folder

If you are using React Native >= V.060 nothing to do

If you are using React Native <= 0.59

Check this link : https://github.com/wkh237/react-native-fetch-blob/wiki/Manually-Link-Package

Is part 2 of the installation actually

react-native link

? I think it should be

react-native link github:wkh237/react-native-fetch-blob-package#master

first it has changed to rn-fetch-blob https://github.com/joltup/rn-fetch-blob

then when you install it then Do the linking manually, it worked for me

https://github.com/joltup/rn-fetch-blob/wiki/Manually-Link-Package

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!