“file not found” in Bridging Header when importing Objective-C frameworks into Swift project by CocoaPod
Asked Answered
M

2

4

I got a swift project ,and use CocoaPod to import the third part repositories. In pod file I use use_frameworks!, so the repositories will build into framework to use. And I import the ObjC framework like #import "" or #import <> in my Bridging Header.
In this situation, I run the project, it works. but When I archive, “file not found” is found in Bridging Header file.

`BridgingHeader.h:5:9: error: 'RESideMenu/RESideMenu.h>' file not found 
#import <RESideMenu/RESideMenu.h>
<unknown>:0: error: failed to import bridging header 'xxx-Bridging-Header'`  

and

`failed to import bridging header '/Users/xxx/Documents/xxxProjectName/xxxProjectName/xxxProjectName-Bridging-Header.h'`

How can i solve the problem?

Medieval answered 2/12, 2015 at 15:34 Comment(1)
I'm facing the same issue but when i run XCode bot integrationConstituent
M
8

My solution is :
Do not import the ObjC framework in bridging header file, just import the framework in the files in which the framework is needed. just like:
import xxxframework

Medieval answered 2/12, 2015 at 15:34 Comment(2)
Thanks a ton! Initially error was "Command failed due to signal: Segmentation fault: 11" with BridgingHeader "file not found".Namesake
If I do what you say, I get a "no such module" error on the "import xxxframework" line of my .swift file.Mccarthy
M
1

I went to Target->Build Phases -> Link Binary With Libraries added the framework I was trying to import inside the bridging header file.

It fixed the error for me.

Medicable answered 22/4, 2016 at 16:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.