React/RCTBridgeDelegate.h' file not found

I have created a new project called auth using react-native init auth at terminal.When i tried to run the project using react-native run-ios. The build failed and gave a error 'React/RCTBridgeDelegate.h' file not found.

Tried to update the react native version

react-native run-ios at terminal in mac

I expect the build to be successful and see the ios simulator The actual result which i got is build failed and hence cant see the simulator

9 Answers

The issue is related to cocoapods dependency manager. Do the following ot fix this:

  1. Open the terminal and go to your project ios directory
  2. Type in pod init (If it doesn't exist) and then pod install
  3. Open the workspace project and delete the build from ios folder
  4. Run react-native run-ios from terminal.

It should work now.

8

In my case the libPods-FOO.a library had somehow become unlinked when I did a pod update && pod install. To see if this applies to you:

  1. In Xcode, check under Project Navigator:

    [Your Project Name] --> Targets --> [Your target name] --> General
  2. Scroll down to Frameworks, Libraries and Embedded Content

  3. If you don't have a libPods-XXXX.a in there (where XXXX is your project name) then add it:

    1. Click the '+' sign to add the libPods library
    2. Search for libPods in the search box
    3. Choose the libPods-XXXX.a and click Add.

Add library

libPods.....a

Just a hint: for those of you using the M1 Macs, pod install won't work. You should use arch -x86_64 pod install as stated in this issue

1

In case you have Mac with an Apple M1 chip, It can be resolve in two ways,

#SOLUTION 1

  1. Open Application->Utilites->Terminal.app
  2. Right-click, Terminal.app -> Get Info -> General-> Enable "Open using Rosetta"
  3. Restart Terminal

enter image description here

#SOLUTION 2

  1. From terminal execute

sudo arch -x86_64 gem install ffi

  1. Go to iOS directory and execute

arch -x86_64 pod install

1

I did what @Vahid suggested, but I also had another issue. A set of instructions I was following told me to pull the related .xcodeproj file into my actual project and then manually link a few different files.

These steps were not necessary and were creating the issue for me.

I was following this:

But it's better to use this npm package and follow their instructions:

In this particular project, certain targets were not working. I noticed the broken targets with this error were missing libPods-myProjectName.a. Under Targets -> General tab, "Frameworks, Libraries and Embedded Content" I pressed the "+" icon and searched for "pods" and added "pods-myProjectName.a" and now it seems to work. This might not be applicable to you, but I am adding this as another possibility of what might be wrong.

follow this steps :

  1. Select your project on Xcode

  2. Go to Build Settings

  3. In Search path tab select Header Search Path and add this values for both debug and release

    $(inherited)

    ${PODS_ROOT}

    ${SRCROOT}/../../../ios/Pods/Headers (Make sure to set it to recursive)

enter image description here

[Mac OSX] I updated the cocoapods versionbrew upgrade cocoapods

It can happen if you are using mac on M1 chip and trying to run the app on a simulator. Try to install iterm2 from official site(), and launch it with Rosetta(Applications -> Right click on 'Iterm2' app -> "Get info" -> Check "Open using Rosetta"). Then run:

  1. sudo gem install cocoapods
  2. rm -rf /Users/{USERNAME}/.cocoapods/repos/cocoapods
  3. Go to your project folder and run cd ./ios && pod install
  4. Run build with npx react-native run-ios

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like