Generated header file not found in xcode - ios

We are working on a swift project where we use a little bit of Objc.
I have two targets and one framework with a big part of the code (also the mixed code) inside it. My two targets including this framework. (screenshot)
Now I keep getting this error.
'Nexx4-iOS-Swift.h' file not found
Nexx4-iOS is the generated header file that is been created. When I look inside derived data I will find this file. But I cannot navigate (CMD-click) to the file. So it seems that that there is some thing wrong with the linking of it?
Any help?

First remove is header file path from the Build Setting in Project in each target.
And again recreate header file.

Go to Build Settings under Packaging, search for Defines Module and set it to Yes. Hope this may helpful.

Related

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.

Importing a library in to an Xcode 7 project

So I am trying to add a static library to my project in order to interface with a scanner. I have linked the binary in build phases to the libCaptuvoSDK.a, put the Captuvo.h header file in the project folder, and finally set the project to always search the user paths and added $(BUILT_PRODUCTS_DIR) recursive to the user header search paths. After doing all this I am trying to use #import "Captuvo.h" in my ViewController.swift file and getting the 2 errors Expected identifier in import declaration, and Expected expression. I have tried different combinations of importing and none of them seem to make a difference so I am led to believe the issue is with my process of adding the library.
I am new to Xcode and have never used a third party library in an application before so I feel I may be making a simple mistake or just misinterpreting things. Any help is appreciated!
Okay so I managed to fix my issue! I had imported the static library properly but the real issue was the header file. I fixed my issue by creating a new file in my projects folder named Quick-Scan-Bridging-Header.h. Inside that file is where the #import "Captuvo.h" line belonged. Once that was done I opened the Quick Scan apps build settings and under Objective-C Bridging Header I added the path Quick Scan/Quick-Scan-Bridging-Header. I also added the Header Search Path $(BUILT_PRODUCTS_DIR)
After I did all this I am able to use the Captuvo classes in my ViewController.swift file.

XCode - iOS - <OCMock/OCMock.h> file not found

I Have an iOS application that I am trying to add OCMock to in order to better unit test it. I've followed the instruction on ocmock.org as well as instructions I've found in other places but still I cannot get my test code to compile.
Here's what I've done
Added the source code to my project directory
Create the groups in my project to mimic my file system
I selected the option to add to my test targets so the framework was added appropriately as well as the Library Search Path
Then I manually added the headers to the Header Search Path
And added the -ObjC linker flag
Then when I go to import the header file, I get the file not found error
Any ideas what I am missing here???
You have the search path test/libraries/OCMock. Then you have #import <OCMock/OCMock.h>.
This fails because there is no file test/libraries/OCMock/OCMock/OCMock.h.
You use the search path test/libraries, or you can create a prefix directory to hold OCMock and have the search path point at that.
I generally have a directory with the library name and version number before the actually directory.
The directory test/libraries/OCMock-X.X.X could contain the OCMock directory. That way the search path still be more specific: test/libraries/OCMock-X.X.X and you still use OCMock/OCMock.h as the include.
One more thing to check, for anyone else having this problem - I copied OCMock from one project to another and everything looked right, but it wasn't finding the include file. It turned out that even though I had the right groups in Xcode, the files had all been dumped into one directory. I needed to create folders on disk and associate them with the groups in Xcode. The accepted answer here clued me in to what was wrong (though as is often the case, in hindsight it should have been obvious).

Xcode doesn't see the file

I have this file structure:
But Xcode doesn't see file for :#import "VKSdk.h" , because it's in another project, what do I need to do:
Perhaps consider looking into how to work with workspaces in Xcode. It offers great features when working with multiple interconnected projects.
Check this out
https://developer.apple.com/library/ios/featuredarticles/XcodeConcepts/Concept-Workspace.html
VK guid said to add only sdk.xcodeproj file, so it didn't see all the files in this added project, but when I tried to cope these files into the project, it failed to launch.
I added $(PROJECT_DIR)/DatingService/3d\ Party/VKAPI/sdk into Header Search Paths of Build Settings and now it works.
Try to clean your project. I hope it helps
File is not present make sure you are writing right class name
Make sure file is present over there.
If you are adding file from somewhere it is recommended to tick the check box copy item into destination folder.
Fix: you need to update User Header Search Paths in Build Settings like this ../**
Look at the image: https://www.dropbox.com/s/beytwz8ev262l53/header_vksdk_fix.png

cant import NYXImagesKit library

I am trying to import the NYXImagesKit library in to my iOS 5.1 project but it will not show up as importable code. It cannot find the library. I have dragged the NYXImagesKit library in to the project and added the libraries. I have also added the following to my build phases:
However I still get an error saying it cannot find NYXImagesKit.h when i try to import it.
NYXImagesKit can be found from here: https://github.com/Nyx0uf/NYXImagesKit
Ive used this in a previous project so I know that it works.
screenshot of location of .h file:
header search paths:
You are not having an issue with "importing" the library proper. (I would not like to appear pedantic, but a library is linked, not imported). The issue you are having is with the header file which comes with the library.
To fix it, you should make sure to add the path to NYXImagesKit.h in your project build sentting (Search Headers Path). This can by found under Build options in your project settings.
Alternatively, an easier way is to add the NYXImagesKit.h file to your project (like any .m file). Then it will be found without the need to specify an header search path.
EDIT:
Since from what you report, everything seems ok, he only idea I can come up with is making sure that the paths are defined for your target (as opposed to the project overall); but I guess it is already like that.
Other than that, only resort is thinking that the project got corrupted somehow. You can inspect the project.pbxproj file inside your .xcodeproj document with a text editor and ensure that everything looks fine.
If everything fails, just start over with a new project.

Resources