fraxool
fraxool

Reputation: 3219

Bridging Header File can't find an imported Objective-C project

I'm trying to import this library (SCRecorder) into my Swift project using the "Bridging Header File" method. But I really can't make it work. When I try to build the project, I get the following error :

error: 'SCRecorder/SCRecorder.h' file not found 
#import <SCRecorder/SCRecorder.h>

Here is the content of my bridging header file :

#ifndef Project_Bridging_Header_h
#define Project_Bridging_Header_h

#import <SCRecorder/SCRecorder.h>

#endif

And here is my project structure :

enter image description here

Of course I have added the reference to the Bridging Header File in my Build Settings. I'm almost sure it's just a path issue... But after some hours spent on this, I really can't find a solution.

Thanks.

EDIT : Instead of importing the project directly, I have added it with the CocoaPods method, and I get a new error :

library not found for -lSCRecorder

Upvotes: 1

Views: 1192

Answers (3)

Julian
Julian

Reputation: 9337

I had a similar issue with pods. Basically trying to run my UI tests, Xcode complained about missing pods. Solution to this was:

  1. go to project file (main not a target)
  2. click on the "Info" tab (most left)
  3. set proper pod configuration for UI tests target ("Configurations" section right under "Deployment Target")

Working!

A bit more about this: https://github.com/CocoaPods/CocoaPods/issues/2695

Upvotes: 0

fraxool
fraxool

Reputation: 3219

OK. I figured it out. I just didn't use the *.xcworkspace project after installing pods... After opening my project with this file, everything works well, as expected.

Thanks for your help, especially @kaizoku for suggesting me to use this file.

Upvotes: 1

votelessbubble
votelessbubble

Reputation: 805

You should try to install the library using 'cocoapods'
There could be something wrong while importing the project manually.

Here is a tutorial on how to install Cocospods and initialise your podfile in your application.

Then you can add pod 'SCRecorder' in the Podfile and go back to the terminal and type pod install.
This will install all the dependent libraries for SCRecorder.

Finally, go and try running the build. It should work.
Safe side, keep a backup of this build. Good Luck :)

Upvotes: 0

Related Questions