0

I imported a header file to a swift project. The header file contained inputs to Parse obj c libraries. Everything worked fine I tested with Parse no problem.

When I saved then closed the project then re-opned I get a compiler error saying the Header file cannot be found. Here is the error.

failed to import bridging header '/Users/callanmooneys/Desktop/iOS Deveolpment/Swit/Lab cases Haematology/Lab Maternity Haematology/Lab Maternity Haematology-Bridging-Header.h'

Tried everything here:

Swift Bridging Header import issue

I don't understand how all worked fine until I saved the project the re-opened it.

Any input appreciated.

Community
  • 1
  • 1
dancingbush
  • 2,131
  • 5
  • 30
  • 66

3 Answers3

1

Even if Swift isn't in beta anymore, there are still some bugs. So you should try several things.

Community
  • 1
  • 1
Christian
  • 22,585
  • 9
  • 80
  • 106
  • Tried deleting derived data, cleaned (its cleans but when I build same errors), .h file is present, check the file inspector for header file and libraries the path seem correct (is tis what u mean by edit search path?) – dancingbush Mar 08 '15 at 14:03
  • Every time I delete references from the Parse and Bolt frameworks and move the packages to the trash from the project, re copy them over everything works fine, but as soon as i close and re open the project i get this same error! – dancingbush Mar 08 '15 at 14:32
1

You should also try:

  • cleaning the build folder using Shift-CMD-Option-K

  • check the build settings to be sure that the correct bridging header with correct path is selected

  • deleting the bridging header, but only deleting the reference. Then, quit XCode and on relaunch, re-add your bridging header to your project

  • creating a Objective-C header, copying the code of your old header in there, and then setting the new header as your bridging header in project settings

EDIT:

  • try saving the file without spaces
The Hexagon
  • 128
  • 1
  • 9
1

This has been happening to me whenever I use an Obj-C Bridging Header in any of my projects.

Whenever I launch, I get the same error, along with another one that goes something like:

Parse/Parse.h file not found

Every time I launch Xcode, I delete the Parse.framework from my Xcode project completely, then drag it back in.
This fixes the issue for me until I quit Xcode, and then I will repeat upon relaunch.

This has been happening to me for many months, not only with Parse, but it's also happened with RevMobAds.framework. I've gotten used to deleting and reinstalling the frameworks each launch.

George Poulos
  • 539
  • 1
  • 6
  • 17
  • Same, funny though I did note this does not seem to occur if project title has no spaces, but will your app run when deployed to app store? – dancingbush Mar 08 '15 at 17:11
  • That is quite interesting. All the projects that this has been happening with do indeed have spaces in the project name. But to your question, I have successfully submitted an app to the app store while this problem was occurring (this was with the RevMobAds framework) and everything went fine, and the ads are showing up on the app. – George Poulos Mar 08 '15 at 17:13
  • Cheers, see below comments I just started a new project with a project name without spaces, I plan to change the name as it appears on App store to a name with spaces (assuming this is possible) – dancingbush Mar 08 '15 at 17:31