2

I've set up a fresh react native project, and instantiated a cocoa pod .xcworkspace doing:

cd ios
pod init 
pod install

I've then added a pod that I want to use (in this case being Buddybuild, although it doesn't really matter which pod i add, as the behavior is similar)

After I run pod install and include the header #import <BuddyBuildSDK/BuddyBuildSDK.h> in my AppDelegate.m , it is always returning me a /Users/nik/dev/myproject/ios/myproject/AppDelegate.m:14:9: 'BuddyBuildSDK/BuddyBuildSDK.h' file not found

I've battled with this all day and I have no idea why. The headers are all there in the Pods/headers/Public folder. They're being included in the header search paths in build settings as well as you can see here:

enter image description here

I'd highly appreciate help on this as I'm very stuck.

EDIT Also here's my Podfile:

enter image description here

volk
  • 1,196
  • 1
  • 12
  • 31

2 Answers2

1

Turns out the issue was an xcode thing. After much Googling the issue that solved it was making sure that my projects configurations were properly set. So going to Project -> Info -> Configurations And choosing the right Pods-projectName.debug and Pods-projectName.release configurations.

volk
  • 1,196
  • 1
  • 12
  • 31
  • Are you using custom build configurations by any chance? I'm trying to get pods to work but it's not building them because the custom build configurations are using Release – SimonTheEngineer Feb 06 '18 at 16:31
  • @SimonTheEngineer I wasn't using any custom configurations. I wish I could help but this was long ago and I've long stopped working on that project :( Sorry – volk Jul 09 '18 at 21:54
0

For RN 0.58.6 I noticed you don't need any react or react-native pods.

If you create a brand new project using react-native init (for 0.58.6) you will notice there is no need for a pod file.

My pod file looks like this:

platform :ios, '9.0'
project 'MyRNProject.xcodeproj'
install! 'cocoapods', :deterministic_uuids => false

target 'MyRNProject' do
  # Comment this line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Add pods that you need here

  target 'MyRNProject' do
    inherit! :search_paths
    # Pods for testing
  end

end

In Project target Linked framework or libraries I have:

  • framework deps (CoreFoundation.framework, SystemConfiguration.framework Pods_MyRNProject.framework etc)

  • RCT and RN deps

  • other libs that I use

enter image description here

enter image description here

Florin Dobre
  • 9,872
  • 3
  • 59
  • 93