0

I am facing this " 'React/RCTBridgeModule.h' file not found" issue that a lot of other people had too. (It's a react-native 0.59.10 project, with Xcode 11. Also, I have activated Maccatalyst)

In my case, I am trying to use different bundleIDs for testing, beta and prod apps as explained in this great article.

My app builds in debug and release mode, it archives for production using the initial scheme. To be able to have a beta app with its own bundle ID, I duplicated the initial scheme and configured it to use the adHoc config. When I use this new scheme for beta builds / archives, I get this error inside one of my code files (so not for a dependency file).

  • I have made sure that React was added as the first target of the build config for this scheme and that builds don't run in parallel.
  • I have added "$(SRCROOT)/../node_modules/react-native/React" in Header Search Path in the build settings of the project main target.
  • I have added React as a dependency in the build phases
  • I have tried to change #import <React/RCTBridgeModule.h>to #import "React/RCTBridgeModule.h" and to #import "RCTBridgeModule.h" without success
  • I have checked that, appart from bundleID and bundle Name, the AdHoc (beta) config is the same as the Release config.
  • As soon a I switch back to the initial scheme, it works well.
  • I also breaks when I try to run my app with the initial scheme but using the AdHoc configuration.

Any ideas ?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Goasmad
  • 69
  • 9

1 Answers1

0

The answer can be found on this post : https://stackoverflow.com/a/19729455/12010394

In build settings, you need to "$(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)" to Header Search Path and Library Search Path with recursive set to true.

And for maccatalyst, I added a second line to both search paths containing $(BUILD_DIR)/Release-maccatalyst, with recursive option.

(XCode builds the new config in its own folder and looks for dependencies only inside that folder but the dependencies are not built into that same folder).

XCode, please do something, you are really wasting our time !!!

Goasmad
  • 69
  • 9