0

I have installed the Facebook SDK using cocoapods in my objective-c project. This is how I added it in the pod file

use_frameworks!
  pod 'Bolts'
  pod 'FBSDKCoreKit'
  pod 'FBSDKLoginKit'
  pod 'FBSDKShareKit'

The problem is that the build failed because of that: 'FBSDKCoreKit/FBSDKCoreKit.h' file not found. I searched about that and I found that if the use_frameworks! is added in the pod file, then the pod "Bolts"; must be added before the pod "FBSDKCoreKit"; (from the facebook documentation). This is what I did but it doesn’t work. I tried also to clean the project, and use this command rm -rf ~/Library/Developer/Xcode/DerivedData but also without any result. Can anyone please tell me where is he problem with what I did?

Edit

When I remove the use_frameworks! this is what I get in the error

ld: warning: directory not found for option '-L/Users/userName/Library/Developer/Xcode/DerivedData/myProject/Build/Products/Debug-iphonesimulator/Bolts' 
ld: warning: directory not found for option '-L/Users/userName/Library/Developer/Xcode/DerivedData/myProject/Build/Products/Debug-iphonesimulator/FBSDKCoreKit'
ld: warning: directory not found for option '-L/Users/userName/Library/Developer/Xcode/DerivedData/myProject/Build/Products/Debug-iphonesimulator/FBSDKLoginKit'
ld: warning: directory not found for option '-L/Users/userName/Library/Developer/Xcode/DerivedData/myProject/Build/Products/Debug-iphonesimulator/FBSDKShareKit'
Ne AS
  • 1,490
  • 3
  • 26
  • 58

1 Answers1

0

Remove YourPod file Because you are using "" and semi colons and add these pod files It will work

pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'

These Frame work import

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

Appdelegate.m

  -(BOOL)application:(UIApplication *)application    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
  {                      

  [[FBSDKApplicationDelegate sharedInstance] application:application
                         didFinishLaunchingWithOptions:launchOptions];
  }

 -(BOOL)application:(UIApplication *)application
        openURL:(NSURL *)url**strong text** sourceApplication:(NSString *)sourceApplication
     annotation:(id)annotation
  {

      return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                      openURL:url
                                         sourceApplication:sourceApplication
                                                   annotation:annotation];
 }
Lalit kumar
  • 1,797
  • 1
  • 8
  • 14