3

So I am going crazy, since I keep on getting the error as described in the title and nothing that I worked.

I will show you what I have tried:

enter image description here

enter image description here

enter image description here

What else can I do?

Please help.

Naresh
  • 16,698
  • 6
  • 112
  • 113
Timo Cengiz
  • 3,367
  • 4
  • 23
  • 45
  • Possible duplicate of [Xcode MyProjectName-Bridging-Header.h does not exist](http://stackoverflow.com/questions/26096402/xcode-myprojectname-bridging-header-h-does-not-exist) – Destrif Jun 14 '16 at 08:35

4 Answers4

8

Creating Bridging Header File Manually

First of all delete the Bridging header file which Xcode or may be you have created. And Select your project goto > Build Settings > Search the keyword. Swift Compiler - General. Click on Objective-C Bridging Header , delete that path. Now clean your Project.

Now select your project > Click on Window in the navigation bar . Select Projects and delete your derived data from there.

Now create a new file , select the Source and then select the Header File and create your Bridging header file . File name must be your projectname-Bridging-Header.h and then create it

Select your project goto > Build Settings > Search the keyword. Swift Compiler - General. Click on Objective-C Bridging Header and now add the path in this Objective-C Bridging Header like projectname-Bridging-Header.h

Now import your classes into bridging header file and you can compile it your code easily.

Your bridging header file looks like this when you are creating your file manually.

Mandeep Singh
  • 2,810
  • 1
  • 19
  • 31
  • I have answered the question since one year ago, At that time Swift compiler is under Code Generation. Now you are checking in the latest Xcode 9. Apple change their feature time to time. I will update it. @Sreejiths Thanks for your update – Mandeep Singh Oct 04 '17 at 07:23
  • @Sreejiths You can check even in the question also. He has added the screenshot Okay – Mandeep Singh Oct 04 '17 at 07:25
3

In your project you don't have bridging-Header.h file, but your project has that path. For this you need to delete that path...

Go to targets file and select Build Settings, ---->Swift Compiler - General, and delete the bridging-Header.h. Follow below screen shots....enter image description here

Delete the bridging-Header.h file in Swift Compiler - General

enter image description here

Now you got like this...

enter image description here

Naresh
  • 16,698
  • 6
  • 112
  • 113
1

If above solutions doesn't work, follow this steps:

  1. Create bridging header as usually.

enter image description here

  1. in Build Settings add prefix + / + bridging file name.

enter image description here

This works for me!

Cristea Victor
  • 146
  • 1
  • 4
0

remove path at project goto > Build Settings > Search the keyword. Swift Compiler - General -> Objective-C Bridging header worked for me.