'FBSDKLoginKit/FBSDKLoginKit.h' file not found (Facebook SDK for iOS v4.2 & Xcode 7)

爱⌒轻易说出口 提交于 2020-01-03 07:06:08

问题


I follow all the steps in This Tutorial and/or Facebook SDK Documentation to install Facebook Login on my App, but when I run the code I get an error. although Facebook mention I can just use import (Swift) to include the framework, I try to do it the old fashion as well with Objective-C Bridge Header.

Error:

'FBSDKLoginKit/FBSDKLoginKit.h' file not found

Screenshot
As you can see the bridge.h is being read by the compiler, but due to internal file error it will throw error.

Bridge.h
In Xcode 6 you don't require bridge header file, I could just do it with import

#import <FBSDKLoginKit/FBSDKLoginKit.h>

This problem is due to Xcode 7 Beta, I have tried to do it on Xcode 6 and it worked perfectly with just an import FBSDKLoginKit. Can anyone tell me a hack around this? or if there is a way to convert my Swift 2 code back to 1.4 and work on Xcode 6.


回答1:


I have the same issue and recognized, that my old XCode 6 projects worked with the Facebook frameworks.

So i try the following workaround and that fixed the problem. however i don't know why:

Facebook iOS SDK 4.2

  1. Create a fresh project in XCode 6
  2. Link the Facebook Frameworks to your project as described in the docs
  3. Close the project and reopen it in XCode 7
  4. The "To Swift 2 Converter" should open within the project - Convert the project to Swift 2
  5. Run the project - in my case everything works fine.

After that i copied my "old" Swift 2 Files into the new project. The app starts without any issues.

I observed the changes by the converter, but can't recognized any change depending the Facebook frameworks.




回答2:


I had the same problem.

Managed to sort the directory by adding the Facebook SDK in "Framework Search Path".

Target -> Build Settings -> Framework Search Paths -> + /Users//Documents/FacebookSDK

it works!

=]




回答3:


For those using cocoapods the solution for me was actually adding FBSDKCoreKit to podfile:

pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'

The facebook documentation is incomplete, they dont mention anything about including FBSDKCoreKit pod reference.




回答4:


For [login,sharekit,corekit].h file not found error , My solution was:

changing framework searchpath of RCTFBSDK (inside library of the project)

~/Documents/FacebookSDK 

to

$(HOME)/Documents/FacebookSDK



回答5:


Had the same issue, instead of updating the search path I solved it by removing the Frameworks from the project and then adding them checking the Copy items if needed box

My header files looks this

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



回答6:


You can simply put ~/Documents/FacebookSDK in Framework Search Paths and it will work for any user




回答7:


this is a known bug: https://developers.facebook.com/bugs/362995353893156/

Check out this solution: Facebook iOS8 SDK build module error for FBSDKCoreKit



来源:https://stackoverflow.com/questions/30745106/fbsdkloginkit-fbsdkloginkit-h-file-not-found-facebook-sdk-for-ios-v4-2-xcod

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!