Following instructions, I've created a bridging header and added to my project. Unfortunately, the following error occurred:
:0: error: could not import Objective-C header '---path--to---header/....h'
In build settings I added header search path string to the location of bridging header, but nothing helped.
Has anyone experienced this problem?
For me deleting the derived data fixed it , I noticed even if I check out from an old commit, the same issue happens.
You can reach that option form Window-> Projects .
I experienced that kind of error, when I was adding a Today Extension to my app. The build target for the extension was generated with the same name of bridging header as my app's build target. This was leading to the error, because the extension does not see the files listed in the bridging header of my app.
The only thing You need to to is delete or change the name of the bridging header for the extension and all will be fine.
Hope that this will help.
For me it was because I forgot to add it to the Target's Build Settings.
This will probably only affect a small percentage of people, but in my case my project was using CocoaPods and one of those pods had a sub spec with its own CocoaPods. The solution was to use full angle imports to reference any files in the sub-pods.
Rather than
I imported in some files from bridgin header files from cocoapods not in a proper way.
Instead of importing
I wrote
And this was my HUGE mistake
Add a temporary Objective-C file to your project. You may give it any name you like.
Select Yes to configure an Objective-C bridging header.
Delete the temporary Objective-C file you just created.
In the projectName-Bridging-Header.h file just created, add this line:
'#import < GoogleMaps/GoogleMaps.h >'
Edit the AppDelegate.swift file:
Follow the link for full sample