React-native-fs: Build Failed on iOS

Created on 21 Jan 2016  路  11Comments  路  Source: itinance/react-native-fs

There is an error: 'RCTBridgeModule.h' file not found.

Most helpful comment

TLDR: check your installed dependencies if you're using version 2.0.1-rc.x

Hey guys, I was having the same problem in a project which currently uses RN 0.32.
After clean installing my dependencies, I noticed the build was failing on XCode. So I looked at my package.json and saw "react-native-fs": "^2.0.1-rc.2". Then I ran npm ls react-native-ls and noticed the actual installed version was 2.0.1-rc.3, which introduces the library import change that was breaking the build. So I did the following:

  • removed the ^ from that line in package.json to force it to install rc.2
  • clean install node_modules
  • on XCode, Product -> Clean then Build again...

And it worked!

All 11 comments

getting this problem, any solution?

@siwymilek Any clue how you solved this would be really appreciated!

I too recently got this error for no apparent reason. Checking versions, build paths, etc.. no luck yet. Prevented builds for over a day now.

I had this occur with the test app last night after an upgrade. I solved it by making sure the "Build Settings" -> "Header Search Paths" was set to include the React library. You should have this entry:

$(SRCROOT)/../node_modules/react-native/React - (Recursive)

You might also be able to fix it by removing and re-adding the reference to library, but that didn't work for me. Hope this helps.

@cjdell Just tried including that in the "Build Settings" -> "Header Search Paths". Unfortunately, no luck :(

@iSimar Did you do it for both Project and Target (in the sidebar)? They are actually two separate configurations (not sure why). Failing that, you could try a reinstall of the react-native module.

Think i found the fix, no need to change "Header Search Paths".

PR created:
https://github.com/johanneslumpe/react-native-fs/pull/238

Also discussed this issue on stackoverflow:
http://stackoverflow.com/a/41664041/3152113

Update: Yupe, works on iOS now.

I am having the same issue. No luck with the Header Search Paths. #238 fixed the issue for me when I applied it manually.

238 worked for me when I implemented it manually, but it just didn't feel comfortable editing a module i don't support.

Eventually I fixed it without modifying the RNFS package by doing the following:

  1. Checked my react-native version. I was running 0.33.0 (default installed by CLI). So I upgraded to 0.36.0. (also tried 0.40.0, but there's a library import change on that build)

  2. I removed all files in ios/* and deleted node_modules. Then I ran npm install && react-native upgrade which installed my upgraded react-native package.

  3. I ran react-native link and I was up and running.

Funny enough, when I popped into the app this morning it threw the error again, but when I ran through the steps above it fixed it for me. Still feel like there's a better solution out there.

TLDR: check your installed dependencies if you're using version 2.0.1-rc.x

Hey guys, I was having the same problem in a project which currently uses RN 0.32.
After clean installing my dependencies, I noticed the build was failing on XCode. So I looked at my package.json and saw "react-native-fs": "^2.0.1-rc.2". Then I ran npm ls react-native-ls and noticed the actual installed version was 2.0.1-rc.3, which introduces the library import change that was breaking the build. So I did the following:

  • removed the ^ from that line in package.json to force it to install rc.2
  • clean install node_modules
  • on XCode, Product -> Clean then Build again...

And it worked!

@vspedr Indeed, we performed the same action and that solved the issue!

Was this page helpful?
0 / 5 - 0 ratings