Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 396
Saranya Avatar asked Jul 06 '19 18:07

Saranya


People also ask

Did not find header Rctbridgedelegate h in framework react?

Do the following ot fix this: Open the terminal and go to your project ios directory. Type in pod init (If it doesn't exist) and then pod install. Open the workspace project and delete the build from ios folder.

How do you delete IOS build in react native?

To clean the iOS build press Option+Shift+Command+K or go to Xcode menu Product -> Clean Build Folder.

Why is react/rctdefines not found in React Native?

React Native 'React/RCTDefines.h' file not found This error appears when RN core libraries aren't referenced correctly, which can be caused by different kinds of integrating or linking issues. It often happens when you have your dependencies linked using relative path in a podfile, rather than statically in a project.

Does react native module bridge work with build error?

However with this newer version of react that project is not present, which would explain why building will fail if you have a native module bridge (its searching for header files that don't exist) I no longer get the build error, but I haven't verified it works. Will update once I get a positive outcome (or a negative one for that matter).

How to add library which doesn't work in React-Native?

1. Open XCode --> To Libraries add `$LibraryWhichDoesNotWork.xcodeproj$` 2. Then for your app in the `Build Phases` add to the `Link Binary with Libraries` the file `lib$LibraryWhichDoesNotWork$.a` I've encountered this issue while upgrading from 0.58.4 to new react-native version 0.60.4.

How do I fix the React-Native link error message?

react-native link. If you see error message similar to the following CocoaPods error message during react-native link, delete the auto-generated Podfile.lock in your ios folder and run react-native link again. [!]


3 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.

like image 91
Vahid Avatar answered Oct 02 '22 10:10

Vahid


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

like image 43
cobberboy Avatar answered Oct 02 '22 10:10

cobberboy


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

like image 26
Marco Galindo Avatar answered Oct 02 '22 09:10

Marco Galindo