Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Xcode cannot find React/RCTBridgeModule.h in a React Native iOS build

Error'React/RCTBridgeModule.h' file not found

Short answer

Xcode finds React Native's headers only when CocoaPods has integrated them and you build the workspace. Run bundle exec pod install in the ios folder, open the .xcworkspace instead of the .xcodeproj, and import the header as <React/RCTBridgeModule.h> with angle brackets, not as a local quoted file.

  • Applies to React Native 0.7x-0.8x, Xcode 26, CocoaPods 1.16
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Check whether CocoaPods has ever been run for this project and which Xcode container you are building from. A missing Pods folder or a build started from the .xcodeproj points at the first two causes.

    cd ios
    ls -d Pods Podfile.lock *.xcworkspace
  2. 2Match what you see, then jump to its fix

    1. 1The ios folder has no Pods directory, or you cloned the repo and went straight to XcodeThe pods were never installed, or the Pods folder is goneFix
    2. 2The error appears only when you open MyApp.xcodeproj; pod install itself succeededYou opened the .xcodeproj instead of the .xcworkspaceFix
    3. 3The failing line is #import "RCTBridgeModule.h" or a path you wrote by handThe import uses the wrong form in your own native moduleFix

What does the error look like?

  • 'React/RCTBridgeModule.h' file not found
  • fatal error: 'React/RCTBridgeModule.h' file not found

Cause 1 of 3

The pods were never installed, or the Pods folder is gone

1Check

React Native's own iOS integration step is what makes the React headers importable from your iOS files. If Pods and Podfile.lock are not there, that step has not run on this machine.

cd ios
ls Pods | head

2Fix

Install the Ruby dependencies and then integrate the pods, both from the ios folder.

cd ios
bundle install
bundle exec pod install

3Verify

Pods now exists and the install finished without errors. Build again from Xcode.

ls Pods | head

Confirmed by reactnative.dev

Did this fix it?

Cause 2 of 3

You opened the .xcodeproj instead of the .xcworkspace

1Check

CocoaPods creates a workspace that contains your app project and the Pods project. Opening only the app project leaves the Pods project, and the header paths it provides, out of the build.

cd ios
ls -d *.xcworkspace
open *.xcworkspace

2Fix

Close the project window and build from the workspace every time.

cd ios
open MyApp.xcworkspace

3Verify

The title bar in Xcode shows the .xcworkspace name and the build passes the import.

ls -d *.xcworkspace

Confirmed by guides.cocoapods.org

Did this fix it?

Cause 3 of 3

The import uses the wrong form in your own native module

1Check

Look at the header or implementation file named in the error. React Native's native module guide imports its headers with angle brackets and the React/ prefix.

grep -rn "RCTBridgeModule" ios --include=*.h --include=*.m --include=*.mm

2Fix

Use the prefixed angle-bracket import.

#import <React/RCTBridgeModule.h>

@interface RCTCalendarModule : NSObject <RCTBridgeModule>
@end

3Verify

Build the app target again. The error on that file goes away.

grep -rn "RCTBridgeModule.h" ios --include=*.h --include=*.m --include=*.mm

Confirmed by reactnative.dev

Did this fix it?

How do I stop it coming back?

  • Run bundle exec pod install after every npm or yarn change that adds or updates a native dependency.
  • Keep the .xcworkspace as the only thing you open for the iOS side; delete shortcuts that open the .xcodeproj.
  • When you add a header search path yourself for a library, do not mark it recursive.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.