Xcode cannot find React/RCTBridgeModule.h in a React Native iOS build
'React/RCTBridgeModule.h' file not foundShort 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.
Fix it fast
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 *.xcworkspace2Match what you see, then jump to its fix
- 1
The 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
The error appears only when you open MyApp.xcodeproj; pod install itself succeededYou opened the .xcodeproj instead of the .xcworkspaceFix - 3
The failing line is #import "RCTBridgeModule.h" or a path you wrote by handThe import uses the wrong form in your own native moduleFix
- 1
What does the error look like?
'React/RCTBridgeModule.h' file not foundfatal 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 | head2Fix
Install the Ruby dependencies and then integrate the pods, both from the ios folder.
cd ios
bundle install
bundle exec pod install3Verify
Pods now exists and the install finished without errors. Build again from Xcode.
ls Pods | headConfirmed by reactnative.dev
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 *.xcworkspace2Fix
Close the project window and build from the workspace every time.
cd ios
open MyApp.xcworkspace3Verify
The title bar in Xcode shows the .xcworkspace name and the build passes the import.
ls -d *.xcworkspaceConfirmed by guides.cocoapods.org
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=*.mm2Fix
Use the prefixed angle-bracket import.
#import <React/RCTBridgeModule.h>
@interface RCTCalendarModule : NSObject <RCTBridgeModule>
@end3Verify
Build the app target again. The error on that file goes away.
grep -rn "RCTBridgeModule.h" ios --include=*.h --include=*.m --include=*.mmConfirmed by reactnative.dev
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Mobile apps
Running pod on a React Native project fails with can't find gem cocoapods
can't find gem cocoapods (>= 0.a) with executable pod
The pod command exists, but the Ruby that is running it has no CocoaPods gem.
3 causes, each with a fixMobile apps
Axios request works on iOS or in a browser but fails on Android with Network Error
AxiosError: Network Error
A React Native app has no CORS, so on Android a Network Error usually means the request never reached the server.
3 causes, each with a fixMobile apps
Axios returns Network Error in a React Native app on iPhone or the iOS Simulator
error.code is ERR_NETWORK and error.response is undefined
A Network Error means iOS stopped the request before any HTTP answer came back.
3 causes, each with a fixMobile apps
backgroundImage: url(...) does nothing in a React Native view
ImageBackground renders an empty area
In React Native the backgroundImage style draws linear and radial gradients, not pictures, so url(...) is ignored.
3 causes, each with a fixMobile apps
A custom font in React Native falls back to the system font
Unrecognized font family 'MyFont'
React Native does not report a missing font, it just draws the system font.
6 causes, each with a fixMobile apps
fetch fails with TypeError: Network request failed in React Native
Network request failed
Network request failed means the request never got an HTTP response, so there is no status code to read.
3 causes, each with a fix