2

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
Stephen Radford
  • 557
  • 6
  • 13
  • Can you share your #import line? – pshah Dec 11 '15 at 22:19
  • Are you `using_frameworks!` in your Pod file? – pbush25 Dec 11 '15 at 22:47
  • Yep, using frameworks. – Stephen Radford Dec 11 '15 at 22:49
  • Added my bridging header – Stephen Radford Dec 11 '15 at 22:50
  • Check my last update. I think you are using the wrong import in your bridging header. – pshah Dec 11 '15 at 22:55
  • @pshah Changed it with no effect – Stephen Radford Dec 11 '15 at 23:04
  • I assume your build settings are not pointing to the correct header. They should be pointing to the header file that you shared. It's worth checking if it's MZFormSheetPresentationController/MZFormSheetPresentationController Swift Example-Bridging-Header.h. If this is the case, it's incorrect! – pshah Dec 11 '15 at 23:07
  • @pshah My build settings are pointing to the bridging header in my project. `$(SRCROOT)/XXXXX/Bridge.h` – Stephen Radford Dec 11 '15 at 23:09
  • I would search for Bridging-Header in build settings and build phases. Something is referencing this file: MZFormSheetPresentationController Swift Example-Bridging-Header.h And if I find it, I would get rid of it because it is not used. – pshah Dec 11 '15 at 23:12
  • @pshah I'm referencing that in my project's bridging header which is referenced in my build settings. The issue isn't with that specific file, it's with the fact that no external frameworks or libraries are being found by my bridging header. – Stephen Radford Dec 11 '15 at 23:16

4 Answers4

1

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>

pshah
  • 2,052
  • 1
  • 21
  • 40
  • Sadly not. This was working previously and the file is one provided by the framework. – Stephen Radford Dec 11 '15 at 22:34
  • The example bridging header exists, as does the one in my project and it's added to the info.plist. It's not just this header I'm trying to import but also from other CocoaPods dependencies and from ConnectSDK. – Stephen Radford Dec 11 '15 at 22:47
1

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.

Dan Beaulieu
  • 19,406
  • 19
  • 101
  • 135
  • Thanks Dan! I've deleted my pods, re-installed them, removed the reference to the bridging header, built the target, added it back in and ran the app and still get the same error. – Stephen Radford Dec 11 '15 at 23:08
0

Change PRODUCT MODULE NAME value same as main target has

xevser
  • 369
  • 4
  • 5
0

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