Hi!
I have an issue when I tried to integrate this module in my code. This error appears at start launch in the simulator/device.
Do you know what can I do?

@pgonzalez , did you run rnpm link after npm install --save react-native-fetch-blob ? it looks like native module not linked.
@wkh237 yes, I did and I still have this error
@pgonzalez , I'm still looking into the problem, I've tried creating a new project and install the package, but I could not reproduce the error. If you're developing on IOS, please check the following settings.
Make sure the module is loaded in your .xcodeproj (should be located in ios/APPNAME/APPNAME.xcodeproj)

Make sure the module has been linked, check General -> Linked Frameworks and Libraries

Recompile the .xcodeproj
when I add to Linked Frameworks and Libraries, I get
* BUILD FAILED *
The following build commands failed:
CompileC < AppProjectDir >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobFS.o RNFetchBlobFS.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
Okay, looks like something went wrong when linking native modules, it would be nice if you could provide me a more complete build log and RN version of the project, I believe it would be helpful !
`Found Xcode workspace App.xcworkspace
Launching iPhone 6 (9.2)...
Building using "xcodebuild -workspace App.xcworkspace -scheme App -destination id=B06E3C4E-5759-43F1-8C98-534E7D017C68 -derivedDataPath build"
User defaults from command line:
IDEDerivedDataPathOverride = < App Directory >/ios/build
=== BUILD TARGET RCTImage OF PROJECT RCTImage WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RNFetchBlob OF PROJECT RNFetchBlob WITH CONFIGURATION Debug ===
Check dependencies
warning: no rule to process file '< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlob/RNFetchBlob.h' of type sourcecode.c.h for architecture x86_64
iOS deployment target '9.3' for architecture 'x86_64' and variant 'normal' is greater than the maximum value '9.2.99' for the Simulator - iOS 9.2 SDK.
CompileC < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobNetwork.o RNFetchBlobNetwork.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd < App Directory >/node_modules/react-native-fetch-blob/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:< User Directory >/Library/Android/sdk/tools:< User Directory >/Library/Android/sdk/platform-tools:< User Directory >/.nvm/versions/node/v5.10.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=< App Directory >/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=< App Directory >/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.3 -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-generated-files.hmap -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-own-target-headers.hmap -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-all-target-headers.hmap -iquote < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-project-headers.hmap -I< App Directory >/ios/build/Build/Products/Debug-iphonesimulator/include -I< App Directory >/node_modules/react-native-fetch-blob/ios/Libraries -I< App Directory >/node_modules/react-native-fetch-blob/ios/../node_modules/react-native/React -I../../React -I../../React/dist -I../../React/lib -I../../react-native/React -I../../react-native/React/Base -I../../react-native/React/Executors -I../../react-native/React/Layout -I../../react-native/React/Modules -I../../react-native/React/Profiler -I../../react-native/React/Views -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../node_modules/react-native/React -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../node_modules/react-native-fetch-blob/ios/RNFetchBlob -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../RNFetchBlobTest/node_modules/react-native -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/DerivedSources/x86_64 -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/DerivedSources -F< App Directory >/ios/build/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobNetwork.d --serialize-diagnostics < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobNetwork.dia -c < App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobNetwork.m -o < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobNetwork.o
In file included from < App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobNetwork.m:14:
< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.h:29:38: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
@property (nonatomic) NSOutputStream * outStream;
^
< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.h:63:23: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
CompileC < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobFS.o RNFetchBlobFS.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd < App Directory >/node_modules/react-native-fetch-blob/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:< User Directory >/Library/Android/sdk/tools:< User Directory >/Library/Android/sdk/platform-tools:< User Directory >/.nvm/versions/node/v5.10.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=< App Directory >/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=< App Directory >/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.3 -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-generated-files.hmap -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-own-target-headers.hmap -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-all-target-headers.hmap -iquote < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-project-headers.hmap -I< App Directory >/ios/build/Build/Products/Debug-iphonesimulator/include -I< App Directory >/node_modules/react-native-fetch-blob/ios/Libraries -I< App Directory >/node_modules/react-native-fetch-blob/ios/../node_modules/react-native/React -I../../React -I../../React/dist -I../../React/lib -I../../react-native/React -I../../react-native/React/Base -I../../react-native/React/Executors -I../../react-native/React/Layout -I../../react-native/React/Modules -I../../react-native/React/Profiler -I../../react-native/React/Views -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../node_modules/react-native/React -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../node_modules/react-native-fetch-blob/ios/RNFetchBlob -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../RNFetchBlobTest/node_modules/react-native -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/DerivedSources/x86_64 -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/DerivedSources -F< App Directory >/ios/build/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobFS.d --serialize-diagnostics < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobFS.dia -c < App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.m -o < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlobFS.o
In file included from < App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.m:15:
< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.h:29:38: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
@property (nonatomic) NSOutputStream * outStream;
^
< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.h:63:23: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
CompileC < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlob-9A9FEEDF0B0FF149.o RNFetchBlob/RNFetchBlob.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd < App Directory >/node_modules/react-native-fetch-blob/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Library/Frameworks/Python.framework/Versions/3.5/bin:/usr/local/bin:< User Directory >/Library/Android/sdk/tools:< User Directory >/Library/Android/sdk/platform-tools:< User Directory >/.nvm/versions/node/v5.10.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=< App Directory >/ios/build/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=< App Directory >/ios/build/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.3 -g -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-generated-files.hmap -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-own-target-headers.hmap -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-all-target-headers.hmap -iquote < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/RNFetchBlob-project-headers.hmap -I< App Directory >/ios/build/Build/Products/Debug-iphonesimulator/include -I< App Directory >/node_modules/react-native-fetch-blob/ios/Libraries -I< App Directory >/node_modules/react-native-fetch-blob/ios/../node_modules/react-native/React -I../../React -I../../React/dist -I../../React/lib -I../../react-native/React -I../../react-native/React/Base -I../../react-native/React/Executors -I../../react-native/React/Layout -I../../react-native/React/Modules -I../../react-native/React/Profiler -I../../react-native/React/Views -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../node_modules/react-native/React -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../node_modules/react-native-fetch-blob/ios/RNFetchBlob -I< App Directory >/node_modules/react-native-fetch-blob/ios/../../RNFetchBlobTest/node_modules/react-native -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/DerivedSources/x86_64 -I< App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/DerivedSources -F< App Directory >/ios/build/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlob-9A9FEEDF0B0FF149.d --serialize-diagnostics < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlob-9A9FEEDF0B0FF149.dia -c < App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlob/RNFetchBlob.m -o < App Directory >/ios/build/Build/Intermediates/RNFetchBlob.build/Debug-iphonesimulator/RNFetchBlob.build/Objects-normal/x86_64/RNFetchBlob-9A9FEEDF0B0FF149.o
In file included from < App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlob/RNFetchBlob.m:12:
< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.h:29:38: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
@property (nonatomic) NSOutputStream * outStream;
^
< App Directory >/node_modules/react-native-fetch-blob/ios/RNFetchBlobFS.h:63:23: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
=== BUILD TARGET RCTGeolocation OF PROJECT RCTGeolocation WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET React OF PROJECT React WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTSettings OF PROJECT RCTSettings WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET IQKeyboardManager OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTLinking OF PROJECT RCTLinking WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTNetwork OF PROJECT RCTNetwork WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET Pods-App OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTActionSheet OF PROJECT RCTActionSheet WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTText OF PROJECT RCTText WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTPushNotification OF PROJECT RCTPushNotification WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTVibration OF PROJECT RCTVibration WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTWebSocket OF PROJECT RCTWebSocket WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET Pods-AppTests OF PROJECT Pods WITH CONFIGURATION Debug ===
Check dependencies
Installing build/Build/Products/Debug-iphonesimulator/App.app
Launching com.Company.App
com.Company.App: 2089
`
react-native-cli: 0.2.0
react-native: 0.27.2
Thanks @pgonzalez , this is helpful ! I'm think I know where the problem is : )
@pgonzalez , what your the version of your Xcode? It might be a problem with Xcode version, please check #31 .
I've published a new version v0.5.6 which removed these problematic code, I think it should be able to solve this problem: )
I got rid of this error just rebuilding the project.
Was there a solution to this?
@AlisonWonderlandApps I just got into this error after installing the package and simply refreshing my app on the iOs simulator. Closing everything and running react-native run-ios again solved my problem :)
newbies? read this post. https://blog.nativebase.io/adding-third-party-native-modules-using-react-native-cbcb9e3786ba
I had the same issue
Didn't work with react-native link but worked withreact-native link react-native-fetch-blob.
clean the xcode project and rebuild with react-native run-ios
hope this will helpful
For me, using react-native link didnt work, until i tried rnpm link. Which loaded the react-native-fetch-blob project in my ios project. then it worked.
Hello i have solved this issue---- 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
Hello i have solved this issue---- 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
react-native link react-native-fetch-blobrnpm linkEven restarting the simulator, the bundler and clearing cache it did not work.
After that, I have opened the project in Xcode and did the following:
.xcodeproj to the Libraries folder
_Alien Catalog is the name of my project_

Click on your project name on the top-left corner in the files sidebar, then under the main panel there will be several tabs, click on "Build Phases", then expand the "Link Binary With Libraries" pane and click the "+" (plus) button:

As I'm developing an iOS-only app, I only bothered making it work there, so no clue if it works on Android.
Versions:
{
"react-native": "0.56.0",
"rn-fetch-blob": "github:joltup/rn-fetch-blob#master" // @0.10.8
}
I hope this helps someone with the same problem.
And to the maintainers: thanks for the lib, it is great :)
Any pointers on what to do when this error occurrs when running tests?
@schumannd Same. Did you find solution?
Nope, I switched to using an older version of the package. I will start another try to update to RN 57 and newest rn-fetch-blob soon
@schumannd
I'm already using rn-fetch-blob and had errors during tests.
Found solution here
Added __mocks__/rn-fetch-blob.js file with
const existsMock = jest.fn();
existsMock.mockReturnValueOnce({ then: jest.fn() });
export default {
DocumentDir: () => {},
ImageCache: {
get: {
clear: () => {},
},
},
fs: {
exists: existsMock,
dirs: {
MainBundleDir: () => {},
CacheDir: () => {},
DocumentDir: () => {},
},
},
};
And tests are passed successfully.
"rn-fetch-blob": "^0.10.13"
After having the same issues, I managed to install react-native-fetch-blob and get rid of the Cannot read property 'DocumentDir of undefined' by:
I think the important part that I was missing even previously is to run pod install for iOS.
For Android, the reason it didn't work for me previously might be related to the fact that I'm using react-native-navigation in my project, which means my MainApplication.java is different to the default one (?). This time I just made sure I have the library initialized in getPackages() method and it just worked.
Here's my MainApplication.java for the reference (notice that it extends Navigation Application. It's content is a mixture of the default MainApplication and the one from React Native Navigation installation guide):
public class MainApplication extends NavigationApplication {
@Override
protected ReactGateway createReactGateway() {
ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) {
@Override
protected String getJSMainModuleName() {
return "index";
}
};
return new ReactGateway(this, isDebug(), host);
}
@Override
public boolean isDebug() {
return BuildConfig.DEBUG;
}
protected List<ReactPackage> getPackages() {
// Add additional packages you require here
// No need to add RnnPackage and MainReactPackage
return Arrays.<ReactPackage>asList(
new MapsPackage(),
new RNFetchBlobPackage()
);
}
@Override
public List<ReactPackage> createAdditionalReactPackages() {
return getPackages();
}
@Override
public void onCreate() {
super.onCreate();
Fabric.with(this, new Crashlytics());
SoLoader.init(this, /* native exopackage */ false);
}
}
Hope this helps!
fixed by running react-native link and react-native run-ios
Most helpful comment
I got rid of this error just rebuilding the project.