Failed to import bridging header '/MyProject-Bridging.h'

312 Views Asked by At

I use an objective c framework (CardIO) in my Swift project When I run my tests without import my target everything going Okay Then When I import my Target it pops

@testable import MyProject

Failed to import bridging header '/Users/**/workspace/MyProject-Bridging.h' and MyProject-Bridging.h pop an error 'CardIO/CardIo.h' file not found

> I added the bridging header path in SWIFT_OBJC_BRIDGING_HEADER under my target

1

There are 1 best solutions below

0
On

after many days digging in the internet.. the problem wan in CardIO, change the import line from

#import <CardIO/CardIo.h>

to

#import "CardIO.h"
@import AudioToolbox;
@import AVFoundation;
@import CoreMedia;
@import CoreVideo;
@import MobileCoreServices;

if the error of "framework not found" popped only in the test target, you should add it to test target