Search code examples
iosswiftfacebook-ios-sdk

issue using FBSDK in swift iOS application


I am coding an iOS 8 app in swift using the FBSDK to allow users to log in to my app. So far I have successfully implemented the login feature using the FBSDK v3.25 in swift using a Bridging-Header.h file and updating the info.plist accordingly to the instructions given on the FB developers website. Now I want to make an app (or update my current one) to FBSDK v4.01 but when I follow the same process of integrating it into my app I get the following errors:

-> FBSDKAppLinkResolver.h

    /Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FacebookSDK/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h:21:9: Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver'

    /Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FacebookSDK/FBSDKCoreKit.framework/Headers/FBSDKAppLinkResolver.h:21:9: Include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver'

-> Bridging-Header.h

    /Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h:12:9: Could not build module 'FBSDKCoreKit'

    /Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h:13:9: Could not build module 'FBSDKLoginKit'

    /Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h:12:9: Could not build module 'FBSDKCoreKit'

->FBSDKLoginButton.h

    /Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FacebookSDK/FBSDKLoginKit.framework/Headers/FBSDKLoginButton.h:21:9: Could not build module 'FBSDKCoreKit'

    Failed to import bridging header '/Users/danieloram/Desktop/IOS/SWIFT/FBLoginUsingSDK4/FBLoginUsingSDK4/Bridging-Header.h'

The most obvious thing to note is the last error which says the bridging header cannot be found but it is in the same place as it was for when I was using FBSDK 3.25?

Also, all of the documentation and tutorials on the FaceBook developers website are all in obj-c so finding a solution has been a very frustrating process. Can anyone help diagnose what i am doing wrong? Any help is appreciated!

update

for the time being I have managed to compile my app by following the instructions in the Facebook developers portal and removing all modules from the FBSDK by running the following in terminal

rm -r ~/Documents/FacebookSDK/FBSDKCoreKit.framework/Modules/
rm -r ~/Documents/FacebookSDK/FBSDKLoginKit.framework/Modules/
rm -r ~/Documents/FacebookSDK/FBSDKShareKit.framework/Modules/

this is my workaround until a proper fix is released.


Solution

  • This is a bug and Facebook is currently "assigning this to the appropriate team".

    To get updates to this issue follow this link:

    https://developers.facebook.com/bugs/362995353893156/

    and hit subscribe.

    Some people have found success using the answers on this link (none have worked for me):

    Facebook iOS8 SDK build module error for FBSDKCoreKit