How do I manually add Pods/Headers/Public to the Header Search Paths configuration?

#1
  • I ejected from expo.
  • I ran ‘react-native link’ in the terminal
  • I moved into the iOS folder and ran ‘pod install’ in the terminal.
  • Then I opened the padel.xcworkspace in xcode.
  • When I try and build the app I get an error that says the React/RCTBridgeModule.h file is not found.
  • After much googling I understand that I need to “manually add Pods/Headers/Public to the Header Search Paths configuration” as described in the expo docs https://docs.expo.io/versions/latest/guides/expokit.html#changing-native-dependencies
  • I have absolutely no idea how to do this. Can someone please help me?

When I click on the error message in build time this is what I see:

Where am I supposed to add ‘Pods/Headers/Public’

My best guess is that I have to add an additional path in the ‘Header Search Paths’ section. Teh problem is that I don’t understand where BUILT_PRODUCTS_DIR corresponds to so I don’t know how to walk it to the pods folder.

Any suggestions?

1 Like
#2

I have the same issue :frowning:

#3

So I figured it out. Found a good explanation of how to manually link in step 3 here https://facebook.github.io/react-native/docs/linking-libraries-ios.html#manual-linking

But this turn out not to be the solution for the React/RCTBridgeModule.h error. Instead I had to go into the node module folder > react-native > React and then drag the React.xproj file into the libraries folder on the left hand panel in your project in xcode.

Once I had the React library in xcode then I clicked on the root folder in the left hand panel, then I clicked on my project name under TARGET in the next left hand panel over, then I clicked on Build Phases in the header and under Target dependencies I added (there is a plus symbol below the table of dependencies) the new React Library under React.

#4

Hi joshpitzalis,

I have the same problem, but I still cannot fix the problem after follow your instructions. Can you give me more details about this problem? Thank you!

1 Like
#6

After a lot of trial and error, finally got the react-native-in-app-utils module to work.

After the error show here:

31 PM

Click on InAppUtils to load this screen:

  1. Click on Build Settings
  2. In the search bar type Header Search Paths
  3. Double-click the entry field

  1. Click the + symbol
  2. Enter the full path to your Pods/Headers/Public directory.
  3. Select recursive.
  4. Clean and Rebuild

Hope this helps someone avoid all the headaches of integrating IAP in ExpoKit.

2 Likes
#7

I gave up on this before I saw your description of how to get this working.

If a react-native module has pod install instructions - or a Podspec file - sooooooo much easier to install by changing the podfile (project > ios > podfile) like this:

pod ‘react-native-in-app-utils’,
:git => “https://github.com/chirag04/react-native-in-app-utils

1 Like
#8

We’re hoping this can be landed soon, which should make this whole situation way less painful.

(edit: it landed, so any third-party library which has a .podspec should just work with react-native link and there would be no need to modify the header search paths.)

2 Likes
#9

After detaching from Expo, I’m trying to add the React Native Share Extension but getting below error. If someone can help would be very grateful.

I have Followed this Link https://www.npmjs.com/package/react-native-share-extension for referencing integrate image share from gallery to my app.If someone can help would be very grateful

Thanks

#10

Well, it doesnt seem that it fixed it, I’m still gettign the same issue. Been tryign to fix it for more than 48 hours now. About to give up.

#11

Can you share your path with us ? I entered “${SRCROOT}/ios…” but nothing’s changed

#12

I have added $(SRCROOT)/…/node_modules/react-native-share-extension/ios path

#13

Hey there!

  • The PR I referenced in my previous comment several months ago has landed in the interim, so react-native link works with any library that supports CocoaPods now.
  • If your third party lib doesn’t support cocoapods, you either need to add the relative header search path manually as described here, or alternatively you can ask the maintainers of that library to add cocoapods support.

With regards to react-native-share-extension that @sudeep asked about, it looks like the author hasn’t updated that library in a long time. Newer react native requires a triangle-style import such as <React/RCTBridgeModule.h>. So your best bet is to help the author fix that library.

Closing this very old thread since the original question doesn’t apply any more. Please open a new thread if you encounter new issues.

Additional clarification for linking header search files
closed #14