47

After updating to CocoaPods 0.36.x, I am unable to add imports into my Bridging-Header.h file. I get the "DBSphereView.h file not found".

The file is indeed present in:

"Pods/DBSphereTagCloud/DBSphereView.h"
"Headers/public/DBSphereTagCloud/DBSphereView.h"
"Headers/private/DBSphereTagCloud/DBSphereView.h"

My bridge file:

#ifndef Loan_Bridging_Header_h
#define Loan_Bridging_Header_h
#import "DBSphereView.h"
#endif

I am able to use Frameworks. I have a reference to a well known Framework (Alamofire), and it works great!

My podfile:

source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod 'DBSphereTagCloud', '~> 1.0'
pod 'Alamofire', '~> 1.1'

Before updating, I had no problems with importing header files.

How do I reference header files in Bridging-Header.h after updating CocoaPods to 0.36.x?

Thank you!

EDIT:

I also tried to create a separate project based on the example "Get Started" from cocoapods.org, without success. After using Frameworks, I can't seem to reference header files in my bridging header file. I must be missing some detail?

MGY
  • 7,245
  • 5
  • 41
  • 74
nmdias
  • 3,888
  • 5
  • 36
  • 59

5 Answers5

106

In your Podfile, you specified use_frameworks!.

As a result, the Objective-C code you're including as a dependency (DBSphereTagCloud) is packaged as a framework, instead of a static library. Please see CocoaPods 0.36 - Framework and Swift Support for more details.

As a consequence, you don't need a bridging header file. It's enough for you to add:

import DBSphereTagCloud

in all the Swift files that need that module.

Para
  • 3,681
  • 4
  • 23
  • 34
53

I had problems with this. My bridging header wasn't finding pod libs. I ended up finding out that I have to do this.

enter image description here

villy393
  • 2,985
  • 20
  • 28
  • I was having trouble with a framework after turning on use_frameworks! I was getting the error "MTLModel.h not found" in an obj-c class that was referenced in my bridging header. Adding Pods to the User Header Search paths, as this answer says to do, resolved my problem. – pinkeerach Sep 02 '17 at 19:39
4

Try this:

import  <DBSphereTagCloud/DBSphereView.h>
import  <DBSphereTagCloud/DBSphereView.h>
Undo
  • 25,519
  • 37
  • 106
  • 129
Nurdin
  • 23,382
  • 43
  • 130
  • 308
-1

For me...

Original

import  "<Folder/File.h>"

Change to

import  <Folder/File.h>
Byron Coetsee
  • 3,533
  • 5
  • 20
  • 31
-1

In Project > Build Settings > Search Paths > Header Search Paths

Add:

"${PODS_ROOT}/Headers/Public/[Name of folder which pod files are contained in]"

Do that for every pod you installed

stephen
  • 1,617
  • 3
  • 20
  • 27