Objective-C cocoapod bridging issue - ios

Followed this to a t:
https://medium.com/#kirualex/cocoapods-with-swift-e6f8ba8f0afc
Can't find these 2 header files though.
Set the bridging file in the settings:

I always meet this kind of problem. I think you can try to check your file&folder hierarchy.
Such as you have a root folder named Project, as is often the case, there is another Project in your previous Project, the root folder.
And Checking the Objective-C Bridging Header in the Build Setting. Sometime error can occurred for Project/Project/Bridging-Header.h. And the error can be corrected by changing the definition as Project/Bridging-Header.h.
If the location of Bridging-Header.h is not matching with the definition in the Build Setting, the error like import file not found will occur.
I just tell your my solution for Bridging issue I already met, I hope it can help you.

Related

Cannot import Swift code into Objective-C in spite of following recommended settings. Manual bridging possibility?

I cannot get my swift files imported into my Obj-C project. I know, there’s a lot already on this topic on stack overflow, and I’ve tried all answers in this thread on importing Swift code to Objective-C, but I've still got the same error in spite of what I've tried for my project called Plantasia:
When at the top of the script of the .m file of a pre-existing project I do
import "Plantasia-Swift.h"
I get file not found error.
What I've tried:
I've set for both project and example
"Defines Module" : YES
"Always Embed Swift Standard Libraries" : YES
"Install Objective-C Compatibility Header" : YES
Changed the Project Module Name to Plantasia
I’ve cleaned my build folder and tried a bunch of unlikely solutions like #import "Plantasia/Plantasia-Swift.h" , which don't work either.
I’ve tried prepending #objc to class declaration in the .swift file.
I’ve tried manually adding another bridging header, and specifying the "Swift Compiler – Code Generation" to my header.
I've tested starting from a blank Objective-C project, by creating a Swift file, and referenced it successfully within .m file. This shows that it's at least working normally for me in a clean project
I've been trying for hours, and I think there must be one incorrect setting somewhere that I'm unaware of. I've tried basically most of what I could find on the forums. Any additional ideas of things I should still check? Or is there a way of manually creating this "Plantasia-Swift.h" header file?

Xcode refuses to let me import Swift files to Objective-C files ('projectname-swift.h' not found)

I downloaded this Xcode project and I want to use my Swift files in the Objective-C files but the 'OpenShop-Swift.h' file not found error refuses to go away.
I have tried what seems like every solution on Stack Overflow, including from here and here. Most other solutions were duplicates of the common:
In build settings, set defines module to yes and product module name for the target to your project name and make sure objective-c generated interface header name is correct.
This top solution seemed promising but I am having trouble understanding what he was saying.
If you decide to give it a whirl, just know that the project lacks a working backend and won't compile properly if you get past the file not found error. But, if you add to one of the .m files you should be able to get the error before the project finishes compiling.
Technically, this is not a duplicate since all the other solutions have failed.
I have found the solution thanks to #skladek. I created a swift file and allowed Xcode to create a bridging header file for me when it asked, and the error went away.
I thought the bridging header file (OpenShop-Bridging-Header.h) was to allow the importation of Obj-C code to Swift files and not vice-versa. Thus far everything I have read on the internet has corroborated this, so it's not clear to me why this solution works. Thanks to #skladek once again.

Why do I keep getting this error for my bridging Header in Xcode 7: Bridging Header does not exsist?

I updated my Xcode to version 7 and now I get this error saying the bridging header doesnt exist. It tells me that its supposed to be in the /users/desktop/apps/projectname/projectname-bridging-header.h. I checked in the file and its there but xcode still gives me an error. Has anyone had this problem before and know how to fix it. Thanks!
Make a new bridging file with a different name and link to that.
Try cleaning your build folder (Product menu, hold down option to reveal it).
I experienced issues with cocoapods 'useframeworks!' and the build folder was being used, so even after removing it and using an objc version of the library, no matter what I did the bridging header was broken.
I got it to work there was a problem in the Framework Search Paths. I had to add the destination for one of my ad networks.

Swift Compiler Error - failed to import bridging header

I'm trying to integrate Actor App for iOS. On compiling, I get this error :
I checked the path and the ActorClient-Bridging-Header.h is present there.
I have set the proper path to the header file in Build Settings
And this is the folder structure :
What might be the reason for this compilation error?
EDIT
I tried solving the same as mentioned here : Swift Bridging Header import issue and no luck.
Screenshot of the actual path on my disk :
Just go to your project's Framework Search Path,which I assume would be empty and add the path of your SDK folder there.
For adding the path correctly, you can just drag and drop your SDK folder here,the correct path from root will be added automatically.
Hope this will help!!
Bridging header file should be placed at root folder.

Import of framework in swift bridging header not recognised upon archive

I import the Facebook AsyncDisplayKit framework into my app using the swift bridging header, like so:
#import <AsyncDisplayKit/AsyncDisplayKit.h>
It's always worked fine for building and running my app, but when I go to archive, it gives me an error:
import 'file not found'
Why might this not be recognized, upon archiving?
I always meet this kind of problem. I think you can try to check your file&folder hierarchy.
Such as you have a root folder named Project, as is often the case, there is another Project in your previous Project, the root folder.
And Checking the Objective-C Bridging Header in the Build Setting. Sometime error can occurred for Project/Project/Bridging-Header.h. And the error can be corrected by changing the definition as Project/Bridging-Header.h.
If the location of Bridging-Header.h is not matching with the definition in the Build Setting, the error like import file not found will occur.
I just tell your my solution for Bridging issue I already met, I hope it can help you.

Resources