Swift bridging header fail issue - ios

I have an iOS project using swift language which is running normal. Because I worry about the project may miss or other, I copied the project from this address to another address.
when I open this project and run this project. I got those two error tints:
"SVProgressHUD.h" file not found
Failed to import bridging header
I don't understand why this error is happen. And the project in older address is ok.
Has anyone experienced this problem?

on the file manager (left), click on your SVProgressHUD.h file, and look at the path on the utility window (right), or just right click -> show in finder. You will probably find that your file is not where it's supposed to be.

Related

Xcode does not find framework after closing

i have a swift XCode project and i want to import Chartboost framework inside it. it works fine when i import the framework but when i close XCode and re-open, it gives error and says that could not find the files although the files are right there. here is the error :
'Chartboost/Chartboost.h' file not found
Failed to import bridging header '/..../project-Bridging-Header.h'
there are other frameworks inside the project but they do not give any error. i have to delete the framework and then copy it every time i close XCode. how do i fix this ?
1.Please check the Framework Search Path in Target .If this frame work exists in folder name with space for example "Silly Things" .Then it will take two lines.So you have to give the name "Silly\ Things" in Framework Search Path.
2.If you are removing and adding again and again.Then it is just appending again and again in framework path.
So if you are closing and then opening it is not finding with suggested path and might be ending with this error.

Trouble with an .h import

As a beginner in ObjectiveC I need some help.
I'm working on a phonegap plugin for IOS (so, written with objective C). I use some open source code but I got an error with an .h import.
My architecture look like:
myFmk.framework/
myFmk.framework/ABCDE/myFmk.h <== in a sub folder
myFmk.framework/myFmk <=== this is a file
myPlugin.h
myPlugin.m
In myPlugin.h I have #import and in "myFmk.framework/myFmk" file I have only one line "ABCDE/".
I thought that this file do a redirection of the absolute import (with brackets) but my complier told me that "myFmk/myFmk.h" is not found.
I tried to find some documentation about this feature but I wasn't able to find its name... do you have this documentation or the feature name?
Thks.
Is the framework added using a cocoapod? If not, did you follow the instructions properly for adding it to your project? It would probably help if you posted the framework you are experiencing problems with.
If this is a framework that is added to your project properly and you are unable to import there are a few things you should check. First, go to your project settings (click on the project at the very top of your file tree in the left column) and then look for "linked libraries". See if the library is listed there. If not click the + and try to add it.
If this framework was added via cocoapods another thing to check is search your file structure for libPods.a. If it is red, I find sometimes it is helpful to delete it, close the project and run pod install again.
Also if you installed the project via cocoapods remember to open the workspace and not the old xcode project file.
I have also experienced this problem when my header search paths and other linker flag paths were wrong. Linker Flags should be $inherited if this is a cocoapod. In my projects most Header search paths are $inherited too.
If none of this is helpful please provide more information such as how this framework was added to your project and what the framework is. Also let us know if you get any error messages.

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 on New Mac

I just copied my project over to a new mac (xcode/iOS up-to-date). However, I'm getting Swift Compiler Error when I try to build/run.
<unknown>:0: error: opening import file for module 'Swift': Permission denied
Looks like its an issue with my bridger file. So I tried the following
Deleted the old reference under Build Settings > Swift Compiler > Objective-C Bridging Header
Added a new objective-c file and created a new bridge.
However, the error still persists.
Any clue what might be causing this?
Try looking the user permissions of your files and add your new user as the owner of those files. Make sure it applies to all descendent items using the finder get info Owner permissions
Possibly one of the most inefficient solutions: I ended up creating a new project and importing all files, frameworks, plist settings, build settings over. Took a while (the project is fairly large), but ended up compiling.
In my case the "Framework Search Paths" was wrong. There was absolute paths from another computer.

library linked but Xcode says "file not found."

This just started happening with my project and I have no idea what to do.
I've been using the Parse framework and everything has been fine so far. But now, even though the library is included:
and linked:
I still get a "'Parse/Parse.h' file not found" error when I import it into classes. Even weirder (at least to me), the project still builds and runs. When I build or clean the project, the warning disappears, but then it reappears right away.
Any idea how I can fix this?
For all who have not found issue:
Go to Build settings and search for "Framework Search Paths", then remove everything and put ./ and make it recursive (by double-clicking on it)
IMPORTANT - Don't download Parse framework on Windows and then copy to Mac! inside framework there are some links and while copying they get corrupted. Download the framework directly from Mac and when added to xcode make sure it has "Headers" folder under it in XCode frameworks.
I hope it helps some people.
have you tried by changing the #import "Parse/Parse.h" to #import ?
The compiler will search for the header files in a special search path. In your case, it seems that the file "Parse/Parse.h" is not in your compiler's header file search path. Check this in your compiler settings.
How many targets do you have? If more than one, maybe the debug target doesn't include the framework.
I have the same problem when I use the demo called "TodoTable", and I solve this by deleting the link in target -> Build Phases -> Link Binary With Libraries -> Parse.framework, and then, adding it again. You may do it by clicking + button, and choosing Add other..., then, in the project folder, you can find the Parse.framework file. After that, rebuilding your project, and it will be ok.

Resources