facebookSDK 3.1.1 file not found - ios

I use XCode 4.5
I downloaded the SDK 3.1.1 from https://github.com/downloads/facebook/facebook-ios-sdk/FacebookSDK-3.1.1.pkg
and then I import the framework by dragging first and it does not work so I use the method of add other... in the build phases
I have this in my project:
and this in my build phases:
but when I import the FacebookSDK library like this
#import <FacebookSDK/FacebookSDK.h>
I have a file not found:
Did I miss something?

Ok I found the solution.
Actually the problem was from my Framework Search Paths in the search paths category.
I installed several time the facebook package and import the facebookSDK.framework several times and it adds me the link automatically in my Framework Search Paths.
I just removed all links and recreate a correct one manually and it worked.

if you have facebooksdk.frame work and its not working try this.
Remove frame work, delete it. clear your frame work search paths.
drage FacebookSDK.frame again and update your frame work path if you are working in team.

Related

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.

Xcode 7 doesn't autocomplete if using bridging header

So, the problem is that when I import anything in the Xcode 7 using Bridging Header Xcode doesn't autocomplete my code, no matter if I import given framework, header file in my current .swift, if it's just in bridging header Xcode doesn't autocomplete.
Though things are different dependently on framework, if I import Parse framework Xcode doesn't autocomplete at all, like no NSString, no other basic stuff.
When I tried to import FacebookSDK, Xcode autocompletes basic stuff like NSString, but it doesn't autocomplete FacebookSDK related stuff.
Also I tried running same project in Xcode 6 and there autocomplete works properly. Is it something wrong with my Xcode 7 or the frameworks?
I already tried deleting cache, derived data, reinstalling Xcode 7 but none helped.
Any tip?
The solution that worked for me is to make sure you put an individual path for each framework you include in your project as in the screenshot below.
Obj c.
Importing .h files into other .m files in the same project.
For time being i am type casting as work around.
The Facebook SDK frameworks weren't showing up in code completion for me. What finally worked was copying the framework files into the Project directory, though the Facebook official instructions recommend using references to the 'Documents' folder.
I tried the solutions from Morgan and Van Du in adding specific directories to the framework search paths, and doing recursion, but no dice for me. Had to fully copy into project directory (running Xcode 7).
after I have tried every solution at stackoverflow I remove all custom plugins – and this was it.
Xcode -> Windows -> Package Manager (in my case it was something about hightailing strings)

Xcode 6 can't find framework header files when project name contains spaces

I'm using the Parse and PubNub SDK in my project called My Sample App and since I updated my Xcode to 6.3.1 I can't run the project because Xcode doesn't find the header files. I had the same issue with the previous version, but then I just needed to delete and add them again to make it work, unfortunately it doesn't work now. I also tried to delete the Library Search Path and Framework Search Path without any success. Is there any trick that fixes this issue?
This is the exact error:
'PNImports.h' file not found
Add $(PROJECT_DIR) to your Library Search Path in project settings AND select recursive option
Surround Library Search Path with single quotes

external framework File/File.h (Parse/Parse.h) file not found

So every time I update my app, Xcode claims not to be able to find a particular external framework even though it's there. It's happened again with Xcode 6 and my usual methods (I'm fairly inexperienced, so these basically involve clicking and typing things until something happens (I exaggerate but not by much)) aren't working.
I'm getting a Lexical or Preprocessor Issue error that says 'Parse/Parse.h' file not found.' But here are screenshots of it in the project and added to the library:
I also followed the steps in the most upvoted answer at ‘ld: warning: directory not found for option’ but still nothing.
Any idea what to do? Any idea at all? I'm tearing my hair out here.
Actually I was facing the same problem but after doing lots of (removing/adding parse framework) efforts I come to know that parse.framework is already added and error was still there.
Real Problem was not in link Binary for main project but it was with Tests link Binary.
Lets say your project name is "project1" and Xcode create one more folder with it called "project1Tests". So select "project1Tests" and add parse.framework in link Binary.
Check out the hierarchy:
PROJECT
project1
TARGETS
project1
project1Tests (you need to select this to add parse framework).
Hope this would help you resolve this issue.
I had this error also. I'm developing in Swift, so I added a "bridge header" as described in this Parse blog post.
The reason I got the "Parse.h not found" was that my project name contained spaces. (For project name I mean the Product Name you enter when creating a new project, which determines your folder's name.) The first day all went well, but after closing and opening Xcode, it turns out that Xcode interprets the words separated by spaces as different paths.
To fix this, you can go to Build Settings -> Search Paths -> Framework Search Paths and add an "\" before each space. (If you double click the path you'll see that Xcode shows each word separated by space as a different entry.)
Also note that the bridge header with #import <Parse/Parse.h> it's not compulsory: you can simply do import Parse.
All I had to do was remove Parse.framework from this list by highlighting and pressing delete.
Then I went down to the plus sign at the bottom of that list and had to select Add Other and manually locate the downloaded .framework file.
In my case, the error went away after I added the path to the directory where Parse.framework was to the Frameworks Search Paths Build Setting:
My project didn't even have an entry for that setting, so you may need to create it as well.
I had the same issue when upgrading parse to 1.4v. You have to delete Parse.framework from Framework List and from the project directory, when removed from both places copy again and check "Copy items to destination's group folder". It worked for me.
Its work for me.
Just go to Build Active Architecture Only and Debug should be yes and Release should be No
In my case I had to do one more thing additional to Sukhchais' answer.
It seems that though the parse.framework appears in the 'link Binary with Libraries' list for the targets, they might not have linked properly for some reason. Just remove parse.framework from the list and add it again as mentioned. By that way I was able to resolve my issue.
Just to Share my findings in case if somebody might have the same issue:
Accidentally we had two references of Parse.framework inside our source code base at two different places. And a reference of Parse.framework was linked in Build Phases of the target, from the first place. But when the app is compiled, Xcode was not smart enough to get a reference and trowed an error: "Lexical or Preprocessor Issue" error when "Parse/Parse.h" is imported in .pch file.
After spending couple of hours by trying various options, removed a reference of Parse.framework from the source base and kept only a single reference. This solved the issue.
And the app compiled successfully :)
For people coming from Ionic + Cordova if you are getting this error I solved it by removing my current parsePlugin and replacing it with this fork.
For simplicity, I used these console commands (Replace PARSE_APP_ID and PARSE_CLIENT_KEY with your keys in the Parse Console):
cordova plugin rm com.parse.cordova.core.pushPlugin
cordova plugin add https://github.com/grrrian/phonegap-parse-plugin --variable APP_ID=PARSE_APP_ID --variable CLIENT_KEY=PARSE_CLIENT_KEY
Ok, so I was having this problem as well. I uninstalled all my pods, reinstalled them again, and had no luck.
So the good news (and bad news considering the time I spent trying to find the problem) is that I eventually managed to solve it. Apparently, you have to import Foundation/Foundation.h before parse. I don't know whether this will work for you or not, but I tried everything on the net, and only this seemed to work. If you have any instances of this:
#import <Parse/Parse.h>
#import <Foundation/Foundation.h>
flip it around so that Foundation is declared first:
#import <Foundation/Foundation.h>
#import <Parse/Parse.h>
I also read somewhere that some people had issues with Facebook SDK and Parse SDK import. Apparently, the two have Bolt.Framework in common or something, which causes error. I removed Facebook SDK as well, which at first didn't make any difference. I hope I could help.

Three20: No such file or directory found

in the last 4 hours I try to add Three20 to my iOS poject.
I try to avoid it a long time but now I am on a point in which i can't :)
So I added it correctly all to my projects and after around 2 hours of work it compile perfectly!!!
Badly, I got a "No such file or directory found"-error when try to
#import "Three20/Three20.h"
I try nearly every string in the "Header search paths" I can imagine to get this working, but I have no idea...
here is a screenshot of my directory listing:
http://i.stack.imgur.com/9yWjM.png
here is my Header search paths:
http://i.stack.imgur.com/uXEWP.png
What am I doing wrong?
Have you tried to add the three20 framework manually or using the included ttmodule.py script? The script usually takes care of everything. You can either import the framework into an old xcode3 or current xcode4 based project. The python script is located in src/scripts/
Short answer: everything. Three20 has a very clear documentation. Just follow the Adding Three20 to your project section from https://github.com/facebook/three20
At least for Xcode 4.2 and 4.3, you should do a previous step before you click on Product->Archive. This step is clicking on: Product -> Build for -> Build for archiving.
In USER_HEADER_SEARCH_PATHS in Build Setting under the Search Paths section add this:
$(BUILT_PRODUCTS_DIR)/../../three20
$(BUILT_PRODUCTS_DIR)/../three20

Resources