Xcode 7.3 bridging header can't see other headers - ios

I'm creating app in Xcode 7.3 . Using libraries with Cocoapods. In one moment Xcode started not to see headers in my bridging-header. I can suggest it could be because adding new frameworks with pods (e.g. Alamofire)
It is the second time I got this issue. Last time i've just got previous working build and did the same things and it worked. But now that build also does't work.
I can get two types of error:
this if i try to import headers
file not found
and
segmentation fault:11
with this code, if I commend them out

Make sure you have correctly set the path of your BridgingHeader file in Build Settings.

Make sure you have create header file properly and set Objective-C Bridging Header path in build setting properly.

Related

Xcode 13: Headers of Imported Frameworks Inaccessible

I am having trouble with Xcode referencing header files from imported frameworks. The strange thing is that everything worked fine yesterday. But now, I cannot even import the same headers I see one line above that do not give me a compiler error.
You can see in the image below that the compiler is fine with "Ironsource/Ironsource.h" but when I'm trying to add it again it doesn't know what it is (but it did yesterday):
It is not a localized problem to one Xcode project, Xcode cannot see header files in any of my projects. Or more precisely, Xcode cannot see any NEW header files I would like to import but has no problem with the ones imported a day before. So, I am guessing it is something with Xcode, but I cannot figure out what went wrong.
Also, it doesn't matter if I try to reference headers in:
.framework
.xcframework
files.
The frameworks were added manually in the Project Navigator and can be seen properly in Target -> Build Phases -> Link Binary with Libraries.
I am using Xcode 13.3.1. and my project and used frameworks are both pure Objective C. I have both restarted Xcode and my Mac multiple times but they didn't help.
Does anyone have an idea what went wrong?
Framework headers are usually imported with angular brackets "<>". If you use quotes the compiler would search in the User header search paths in which case you would need to add the relevant path to User header search paths. Also make sure to make the header public if you use angled brackets.

React Native - The right way to create bridge header in Xcode

I'm stuck on manually install RN-onesignal on iOS
already followed the instructions but I got an error RCTOneSignalExtensionService.h is not found
after some research, I found this issue that tell me to manually create bridge header, but I don't know the right way to create a bridge header itself (because this is my first time using macOS)
I've tried this step :
in Xcode project go to File->New->File
choose Swift file and Targeting to MyProject and OneSignalNotificationServiceExtension then finish
add #import "RCTOneSignalExtensionService.h" in OneSignalNotificationServiceExtension-Bridging-Header.h
add $(SRCROOT)/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension-Bridging-Header.h at build setting OneSignalNotificationServiceExtension target
but i got an error Bridging header 'MyProjectPath/ios/OneSignalNotificationServiceExtension/OneSignalNotificationServiceExtension-Bridging-Header.h' does not exist
FYI : at this step OneSignalNotificationServiceExtension-Bridging-Header.h file is on my project folder
so i decided to drag n drop the OneSignalNotificationServiceExtension-Bridging-Header.h to OneSignalNotificationServiceExtension folder, but the error still persist
anyone can help me to fix the error?
BTW my Xcode version is Version 8.3.2
Same problem, trying to solve this 3 hours.
Make sure you not missing this step:

iOS clang error no file or directory

I''m very unfamiliar with the iOS build process. I was giving a legacy application that hasn't been touched in a few years, it was targeting iOS 5 before I opened it.
I'm running into an error Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
I could be wrong but I've browsed a few post and it seems like older xCode cersions didn't have a pch file. Any suggestion on how to get this project running again?
Thank you
If this file you are used to bridge OC and Swift,now you should creat a new .header file and Move All Header file Name inside file
and Add Your File Location inside Build setting -> objectiveC Bridging Header
Hope It Works.
It seems the .pch file is missing from the project but reference still exists in the Xcode Settings. So, Xcode is searching for the .pch file but couldn't find the same.
I recommend you to update the GPU-Image Framework as this might be the old framework. Otherwise, Try the below steps:
Go the Build Settings.
Scroll down to the section 'Apple LLVM 8.1- Language'.
You'll see the option for 'Prefix Header' with the path to the .pch file.
Remove the path from the 'Prefix Header'.
Hope this'll solve your issue.

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.

Import Header Error Swift when relaunching app

I imported a header file to a swift project.
The header file contained inputs to Parse obj c libraries.
Everything worked fine I tested with Parse no problem.
When I saved then closed the project then re-opned I get a compiler error saying the Header file cannot be found. Here is the error.
failed to import bridging header '/Users/callanmooneys/Desktop/iOS
Deveolpment/Swit/Lab cases Haematology/Lab Maternity Haematology/Lab
Maternity Haematology-Bridging-Header.h'
Tried everything here:
Swift Bridging Header import issue
I don't understand how all worked fine until I saved the project the re-opened it.
Any input appreciated.
You should also try:
cleaning the build folder using Shift-CMD-Option-K
check the build settings to be sure that the correct bridging header with correct path is selected
deleting the bridging header, but only deleting the reference. Then, quit XCode and on relaunch, re-add your bridging header to your project
creating a Objective-C header, copying the code of your old header in there, and then setting the new header as your bridging header in project settings
EDIT:
try saving the file without spaces
Even if Swift isn't in beta anymore, there are still some bugs. So you should try several things.
Delete derived Data
Clean your Project: Product -> Clean
Edit the search path (First answer)
Check that your .h file etc is still available and you didn't delete it by mistake.
This has been happening to me whenever I use an Obj-C Bridging Header in any of my projects.
Whenever I launch, I get the same error, along with another one that goes something like:
Parse/Parse.h file not found
Every time I launch Xcode, I delete the Parse.framework from my Xcode project completely, then drag it back in.
This fixes the issue for me until I quit Xcode, and then I will repeat upon relaunch.
This has been happening to me for many months, not only with Parse, but it's also happened with RevMobAds.framework. I've gotten used to deleting and reinstalling the frameworks each launch.

Resources