Question

I am new to Facebook SDK with iOS. I want to send invitation to friends on Facebook for using my app for this I am using Facebook (developer.facebook.com)sdk api I have registered my app installed sdk and imported framework. After importing got error as,

 ld: warning: directory not found for option '-  
 F/Users/vijaywebsolutions/Documents/FacebookSDK'
 ld: framework not found FacebookSDKkk
 clang: error: linker command failed with exit code 1 (use -v to see invocation)
Was it helpful?

Solution

Why don't you try CocoaPods for your projects its the dependency manager for Objective-C projects.

Refer CocoaPods

Simple Setup

  • Open Terminal and type sudo gem install cocoapods

Once installed you need to create a simple Pod file in your project directory and add the dependency to that file example.

Go to your project root directory and create Pod File by typing in terminal touch Podfile

Once created add the following line to the podfile.

platform :ios
pod 'Facebook-iOS-SDK',       '~> 3.11.0'

Save the file and then in the terminal(where pod file exist) run pod install

Now it will install the requested dependencies and will create a Workspace for your project, you don't need to take any effort to configure it.

Its the best way to manage your dependencies. Give it a try you won't regret.

OTHER TIPS

First you have to include facebook sdk in you project, steps as follows :

  1. click on your project folder in xcode.
  2. go to general tab and find Linked framework and libraries.
  3. in that click on + sign and provide path to FacebookSDK.framework

These steps will facebook sdk in your project.

Then you have to import it in any of .m file where you want to use is it. like following line :

#import <FacebookSDK/FacebookSDK.h>

I also ran into similar error when integrating FacebookSDK into my app. I have added the framework in the Link Binary with Libraries, however, error persisted. One important thing to note when app is built, is it should be build against source Facebook iOS SDK and NOT binary SDK. I got latest source from here Facebook iOS SDK, downloaded Bolts-iOS and XCTOOL and then ran build_framework.sh Once completed, copied FacebookSDK.framework to my app and everything worked perfect.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top