Maaz Zindani

Loading the index…

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

Xcode cannot find the Objective-C header you import in the bridging header

Error'SomeHeader.h' file not found

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

  • Applies to Xcode 26, Swift 6, Objective-C
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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.h
  2. 2Match what you see, then jump to its fix

    1. 1The 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. 2The 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. 3A 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

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

2Fix

Set the Objective-C Bridging Header setting to the file's current relative path, for both Debug and Release.

MyApp/MyApp-Bridging-Header.h

3Verify

Clean the build folder and build again.

# Xcode: Product > Clean Build Folder, then Product > Build (Cmd+B)

Confirmed by developer.apple.com

Did this fix it?

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

Did this fix it?

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 Module

2Fix

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

Did this fix it?

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

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

Next step

Want this handled for good?

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