Additional clarification for linking header search files

Hi there, I’m still learning the ropes and would love some additional clarification given from the documentation. I had a CRNA app that I ejected to ExpoKit, running the app here runs fine after adding a general ${PODS_HOME}/Headers/Public to my header search paths. After installing ‘react-native-youtube’ I encounter an issue many seem to have which is a header file (in my case <React/RCTDefines.h>) not being found… and the answer in these forums is to check the docs to add header search paths, which is understandable! I should note that linking should work as the youtube npm contains a podspec, that’s beside point at this stage though I guess. But the following sentences confuse me:

The target you care to configure is the one created by react-native link inside your Xcode project. You'll want to determine the relative path from your library to Pods/Headers/Public.

So my questions are:

  1. what’s the best way to find the target that was created by a react-native link? looking at my terminal, when I run link, all it shows is that they’ve been linked successfully
  2. Per the second sentence, my youtube library is in [PROJECTNAME]/node_modules/react-native-youtube and I see the Pods/Headers/Public directory, but what does it mean by “determining the relative path from this library to that pods directory?” What is the specific action I need to take?

Thanks for any and all clarification :slight_smile:

P.S. @ben mentioned that I shouldn’t have to do this anymore since the npm project contains a podspec but this is just mostly showing that I’ve tried searching the forums for a lil fix. Thanks again! How do I manually add Pods/Headers/Public to the Header Search Paths configuration?

That’s odd. I went and looked at their Podspec file and it looks fine. Since this library does have a Podspec, you shouldn’t be encountering any problems with react-native link. I wonder if there is some other issue going on which is specific to this library.

I’m going to answer your questions even though I’m not positive this will solve your particular issue:

To find the target in Xcode, open your project’s xcworkspace in Xcode, and click the Pods project in the left navigator:

Once you do that, a list of Targets should appear in the right panel:

You can examine the header search paths for a particular target:

In this this particular case, the relative path from your-project/node_modules/react-native-youtube to your-project/ios/Pods/Headers/Public will look something like ../../ios/Pods/Headers/Public (but I may have gotten that wrong). The reason we don’t provide most of this detail in the docs is because this will differ between libraries, versions of Xcode, etc., and we try not to duplicate the Xcode docs too much so that we don’t get out of date there.

Hope this is helpful, though I think you may have something weirder going on, since CocoaPods should have just installed your thing correctly.

Hey Ben! Thanks so much for the response, I’ll give this a shot shortly and get back to you. I have a hunch that this is because of a different issue as well. If this doesn’t fix things, I’ll hop on over to the github page for the library and submit an issue report as then we know it isn’t an Expo thing

okay so if I understand correctly, I believe I see where this issue persists. I should be seeing a YouTube-type target correct? And inside that youtube target I need to add ../../ios/Pods/Headers as a search path? When I check my targets I don’t think I see what I need :

Alright @ben so update #3: I think I finally found where you wanted me to look and it seems like the search path was properly added but the project still does not run. I guess this would be a youtube library issue not an Expo thing:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.