user3086708
user3086708

Reputation: 375

Fail when i use Bridging Headers in swift frameworks

I am doing a swift framework and i want to use old objective c classes. For this, i use the bridging headers method but when i try to build appears this error:

<unknown>:0: error: using bridging headers with framework targets is unsupported

I added my {PROJECT}-Bridging-Header.h to Objective-C Bridging Header in Swift Compiler - Code Generation

How can i solved it?

I did in applications and runs Ok, but in this framework no

Thanks

Upvotes: 7

Views: 7939

Answers (2)

iHardikTrivedi
iHardikTrivedi

Reputation: 559

For that follow below steps:

  1. Remove your bridging header and all related file.
  2. Clean Build. Cmd + Shift + k like.
  3. Create new Objective-C file for bridging header file creation.
  4. Now, add your others file.

I hope, this work for you because we solved exactly the same error this solution.

Upvotes: -1

RiceAndBytes
RiceAndBytes

Reputation: 1286

iHart is correct

For that follow below steps : 1. remove your bridging header and all related file . . . 2. Clean Build/Solution. Cmd + Shift + k like . . . 3. Create new Objective-C file for bridging header file creation . . .

But what I had to do also is add all the missing header files to my umbrella header. And also make sure that these files are marked public. In Xcode you can add them to the public section under Build Phases -> Header.

Upvotes: 2

Related Questions