Stephen Radford
Stephen Radford

Reputation: 547

Swift Bridging Header File Not Found

I'm having some trouble importing some headers from CocoaPods and an external library (ConnectSDK) into my bridging header.

I'm getting the following error:

'MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h' file not found

My Pods framework is weakly linked to my target.

Any help really appreciated, scratching my head with this.

UPDATE: Below is my bridging header

#ifndef _Bridge_h
#define _Bridge_h

#import <GoogleCast/GoogleCast.h>
#import <MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h>
#import <ConnectSDK/ConnectSDK.h>
#import <ConnectSDK/CastService.h>
#import <ConnectSDK/CastDiscoveryProvider.h>
#import <ConnectSDK/DIALService.h>
#import <ConnectSDK/SSDPDiscoveryProvider.h>
#import <ConnectSDK/RokuService.h>
#import <ConnectSDK/DLNAService.h>
#import <ConnectSDK/WebOSTVService.h>
#import <ConnectSDK/FireTVService.h>
#import <ConnectSDK/FireTVDiscoveryProvider.h>
#import <TUSafariActivity/TUSafariActivity.h>

#endif

Upvotes: 2

Views: 9621

Answers (4)

Vishal Desai
Vishal Desai

Reputation: 17

if you are using cocoapods then we have to set User Header Search Path to our Bridging Header Path with Recursive Option

Upvotes: 0

xevser
xevser

Reputation: 369

Change PRODUCT MODULE NAME value same as main target has

Upvotes: 0

Dan Beaulieu
Dan Beaulieu

Reputation: 19964

I've done the following with success before.

  1. Save a new copy of your project to avoid losing any important data.
  2. Remove the files Xcode is complaining about from your project and then build your project.
  3. Click your root project > select targets

enter image description here

  1. and scroll down until you see this:

enter image description here

Remove the reference to your bridging header, build and re-add your files.

Upvotes: 1

pshah
pshah

Reputation: 2082

I suspect the spaces are causing problems.

And the import line in the bridging header should be something like this:

#import <MZFormSheetPresentationController/MZFormSheetPresentationController.h>

Update:

I assume you are trying to run the Example from here: https://github.com/m1entus/MZFormSheetPresentationController

It seems like that bridging header file was accidentally removed (or was never there).

You can create your bridging header by following the instructions here: https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

with the following contents:

#import <MZFormSheetPresentationViewController/MZFormSheetPresentationController.h>

Update 2:

Can you change this line: #import <MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h>

to

<MZFormSheetPresentationViewController/MZFormSheetPresentationController.h>

Upvotes: 1

Related Questions