cannot find .h file even after installing ADALiOS pod - objective-c

I installed ADALiOS using pods, and I changed the library search path as per the documentation but I still get file not found when I try the following include
#import <ADALiOS/ADAuthenticationSettings.h>
my search path are as follows
$(SRCROOT)/Pods/ADALiOS/**
I can see the file under the Pods folder/ADALiOS as well but I just cannot link it for some reason
Why is not being picked up?
EDIT --
if I drag and drop the header onto the file it gives me this include path and that works?
#import </Users/mdouhan/Documents/dev/NWMobileTill/Pods/ADALiOS/ADALiOS/ADALiOS/ADAL.h>
I don't understand why its repeated so many times?

Related

Xcode cannot find header files when files added in folder reference mode

I am trying to add many Objective-C files to my Swift project with folder reference mode that means when I drag and drop my files into project I am selecting "Create Folder Reference".
This is because all of my obj-c files use #include "/folder/folder/folder/" for example. These files are generated with j2objc project.
Now my problem is when I want to #import or #include some .h of these files in myproject-Bridging-Header.h Xcode can't find the header files.
I use #import "/folder/folder/folder/" like generated files but no chance.
I add $(PROJECT_DIR)/ in build settings - search header paths but it does need to write path completely like $(PROJECT_DIR)/folder/folder/folder/.
Is there any way to set main folder and Xcode find subfolders ? Or do I need to write every path separately ?
I found the answer after many days by myself!
When I drag and drop my files to my project in Xcode in mode "Create Folder Reference", just a reference to the files is added to Xcode and the files were in their folder where in my Mac.
I resolve this problem by add files to project's folder manually and then drag and drop from that location to Xcode. After that, I could access my file by its address in myproject-Bridging-Header.h like #import "/folder/folder/folder/file.h"

Why is my simple objective c bridging header failing to find the file "BraintreeCore.h"?

This is really frustrating me. I've integrated the Braintree library into several iOS projects before to be used in swift and never really had a problem but currently I can't get it to work.
I have followed/repeated the instructions here over and over:
https://developers.braintreepayments.com/start/hello-client/ios/v4
Specifically, i put pod 'Braintree' in my Podfile, ran a pod install and pod update, and have verified the Braintree library now appears in the Pods directory.
I have re made my bridging header 3 times now too, being careful to set the target to my app. I've also verified over and over that I have set the objective c bridging header in my Build Settings to the correct file, and have it succesfully creating bridging headers for other objective c files. Sadly though the following lines just aren't working in the bridging header:
#import "BraintreeCore.h"
#import "BraintreeUI.h"
They both give a compile error of the same type, saying BraintreeCore.h file not found.
I was able to do the following without getting an error:
#import "Pods/Braintree/BraintreeCore/Public/BraintreeCore.h"
But when I try and do the same for BraintreeUI.h like so:
#import "Pods/Braintree/BraintreeUI/Public/BraintreeUI.h"
It links me to the BraintreeUI.h file and tells me "BraintreeCore/BraintreeCore.h" file not found about this line in the BraintreeUI.h file:
#import <BraintreeCore/BraintreeCore.h>
What am I doing wrong?? this should be straightforward but it's been infuriating me for over 12 hours now.
Full disclosure: I work at Braintree on the iOS SDK.
Your bridging header should not need you to specify a path to the umbrella header files. This might indicate that your Xcode project's build configuration is set up so that Xcode's build system can't find the header files. In a typical project, you should be able to do this no problem.
My suggestion would be to take a close look at the Project > Build Settings > Search Paths settings. In particular, the Header Search Paths setting should contain one entry that looks like this:
"${PODS_ROOT}/Headers/Public/Braintree"
If it doesn't, I suspect that CocoaPods is not playing nice with your Xcode project. You may want to try de-integrating and re-integrating. Using CocoaPods 1.0, you should be able to do pod deintegrate, make sure your Pods/ folder is deleted, and run pod install. Worst case possibility, you may just want to start with a brand-new Xcode project and drag over your old source files (although that might be a big pain).
Did you find a solution, HelloCoding? Facing the same issue ...
In my case, I noticed that the Braintree documentation says "If your app is written in Swift but your CocoaPods integration does not use dynamic frameworks, you can import Braintree in a bridging header".
So I deleted the imports from the bridge file, and included a "use_frameworks!" instruction in my Podfile instead.
I have no idea whether this is the approved way to fix the issue, but it seemed to work for me.

Xcode 6 beta build fails after moving -Bridging-Header objective-c swift xcode6

I am facing build fail error after moving Bridging-Header
objective-c swift on xcode6.
Before I moved header file, it had been working fine.
The error shows header file not exist. The header file path remains still old path in error log. I tried build clean, but still old path remains.
How can clean the objc-header-path?
You need to update the path in your project's Build Settings to point to the new bridging header location.
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".
I tried with Xcode6.1-Beta, as well.
But still impossible to update the objective-c header path.
I don't know where the configuration file is. I gave up to figure out.
Finally, I deleted the target xcode project and recreated new project.
Now it is working.
Yes it's possible.
Delete the .h file
Clear the path at Objective-C Bridging Header
Create new Objective-C File
Name your header file to the same name as before (popup will ask you to create new header file)
Goto File > Project Settings > Data Location
Make sure your path is correct and press "Done"
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
Happens to me many times when i move app folder around.
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
Here's what I did to fix this:
Close the workspace
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.
In my case, I changed the path from relative path to absolute path and solved.
like
From:
project_name/project_name-Bridging-Header.h
To:
$(SRCROOT)/project_name/project_name-Bridging-Header.h

header file not display in xcode project

I'am a newcomer to cocoa developement and i have not yet got used to.
When use eclipse for java development, we can see all the added jars source file if we attached the source files.
But in xcode, we add a framework such as "Cocoa.framework",there is only one Cocoa.h file we can see.
eg:
I clone the 'Sonora' source code from github for study.
there is one line
#import "SNRFileCopyManager.h"
exist in SNRFileImportOperation.h file
Both the SNRFileImportOperation.h and SNRFileCopyManager.h can be found in Sonora/Classes directory.
But, i can see the SNRFileImportOperation.h file in xcode project only and they get work fine together, Why this non third party header file not display in it's own project?
I know something about the dependency setting adn header search paths.
Any one give me a guidance or some references of the code management|organization?
Thanks a lot.
The file SNRFileCopyManager.h is found because it is in one of the include search paths. If you select a header file in Xcode and look at the info panel on the right side you can see that it doesn't actually belong to any target, they are shown more or less regardless. Though, building a framework you can select header files to be included into the framework when building. So, you can just pull in your header files into Xcode.

Compiling in Xcode

I'm compiling a project that was copied from another application file by file from XCODE IDE.
After compilation I get the following error:
Error: could not read data from '/Users/heziflashner/Documents/#import <UIKit/UIKit.h>
#import "MapKit/MapKit.h"
#import "CoreLocation/UserLocationAddress/salesShare03/salesShare03/salesShare03-Info.plist':
The file “salesShare03-Info.plist” couldn’t be opened because there is no such file.
I'm trying to change the framework directory but with no success.
Any one can help?
For framework headers you must use:
#import <MapKit/MapKit.h>
The problem seems to be that you have a file making a reference to saleseShare03-Info.plist. Be sure you have that in your project tree, even try to remove it and then add it again. Else check your .xcodeproj file and check the settings. Copying a project this way is always tricky, good luck.