Xcode cannot find the Objective-C header you import in the bridging header
'SomeHeader.h' file not foundShort answer
Swift sees Objective-C only through headers listed in the bridging header, and the Objective-C Bridging Header build setting must point at that file with a path relative to the project. File not found means the setting is empty or wrong, the header was never listed, or the target is a framework that needs an umbrella header instead.
Fix it fast
1Find out which cause you have
Read what the Objective-C Bridging Header build setting holds and compare it with where the file really is.
# Xcode: target > Build Settings > Swift Compiler - General > Objective-C Bridging Header ls *-Bridging-Header.h */*-Bridging-Header.h2Match what you see, then jump to its fix
- 1
The error appears for the bridging header itself, or right after the file was moved or renamedThe bridging header path in Build Settings is empty or wrongFix - 2
The bridging header builds, but one specific header reports file not found, or Swift cannot see the Objective-C classThe Objective-C header is not listed in the bridging header, or its name is wrongFix - 3
A framework target has a bridging header setting, and imports from it are not foundThe target is a framework, which uses an umbrella header, not a bridging headerFix
- 1
What does the error look like?
'SomeHeader.h' file not found
Cause 1 of 3
The bridging header path in Build Settings is empty or wrong
1Check
The setting is in Swift Compiler - General and needs a path to the header relative to your project, written like the Info.plist path. A moved folder breaks it.
ls MyApp/MyApp-Bridging-Header.h
grep -n "SWIFT_OBJC_BRIDGING_HEADER" MyApp.xcodeproj/project.pbxproj2Fix
Set the Objective-C Bridging Header setting to the file's current relative path, for both Debug and Release.
MyApp/MyApp-Bridging-Header.h3Verify
Clean the build folder and build again.
# Xcode: Product > Clean Build Folder, then Product > Build (Cmd+B)Confirmed by developer.apple.com
Cause 2 of 3
The Objective-C header is not listed in the bridging header, or its name is wrong
1Check
Only headers imported in the bridging header are visible to Swift, and each import has to name a header that exists in the target.
cat MyApp/MyApp-Bridging-Header.h
find . -name "LegacyObjCClass.h" -not -path "./Pods/*"2Fix
Import every Objective-C header you want Swift to see, using the real file name.
// MyApp-Bridging-Header.h
#import "LegacyObjCClass.h"3Verify
Use the Objective-C class from Swift without any import statement and build.
// any Swift file in the same target
let object = LegacyObjCClass()Confirmed by developer.apple.com
Cause 3 of 3
The target is a framework, which uses an umbrella header, not a bridging header
1Check
Frameworks expose Objective-C to Swift through the umbrella header, and the Defines Module setting under Packaging must be Yes.
# Xcode: framework target > Build Settings > Packaging > Defines Module2Fix
Set Defines Module to Yes, and import each public Objective-C header in the umbrella header.
// MyFramework.h (umbrella header)
#import "LegacyObjCClass.h"3Verify
Build the framework target. Its Swift files see the Objective-C class with no import statements.
# Xcode: Product > Build (Cmd+B)Confirmed by developer.apple.com
How do I stop it coming back?
- When Xcode offers to create a bridging header on adding a Swift or Objective-C file, accept it. It names the file after the product module and sets the build setting.
- After moving or renaming folders, recheck the Objective-C Bridging Header path in Build Settings.
- Keep bridging header imports to the headers Swift needs, nothing more.
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
Mobile apps
UserDefaults logs 'Failed to read values in CFPrefsPlistSource' for an app group
Settings saved by the app are not visible to its extension, widget or sibling app that share the group
This log comes from the preferences system when UserDefaults is opened for an app group's suite.
3 causes, each with a fixMobile apps
iOS app crashes: Google Maps SDK must be initialized via provideAPIKey
Google Maps SDK for iOS must be initialized via [GMSServices provideAPIKey:...] prior to use
The Maps SDK throws this when a Maps object is created before GMSServices.provideAPIKey has run.
3 causes, each with a fixMobile apps
UIKit app crashes because it cannot find the storyboard
Could not find a storyboard named 'Main' in bundle NSBundle
UIStoryboard throws this exception when no storyboard file with that name exists in the bundle it searches.
3 causes, each with a fixMobile apps
Firebase on iOS asks for the FCM token before APNs has given one
Be sure to re-retrieve the FCM token once the APNS device token is set.
The Firebase Messaging SDK needs the APNs device token from iOS before it hands out an FCM token.
3 causes, each with a fixMobile apps
A test push from the Firebase console never shows up on the iPhone
didReceiveRegistrationToken prints a token, yet no notification arrives
When a console message is accepted but the iPhone stays silent, the break is between Firebase and APNs or inside the app.
4 causes, each with a fixMobile apps
InstanceID token() no longer works in a Swift Firebase app
Instance ID calls fail to compile after upgrading Firebase to 8.0.0 or later
Firebase removed the Instance ID dependency from Messaging in 8.0.0, so InstanceID.instanceID() calls no longer belong in a current app.
3 causes, each with a fix