0

I'm trying to integrate the facebook login into my swift app by following this tutorial.

I got to step 5, everything runs without errors so far. (i downloaded the SDK, added the core and login frameworks to my project, changed the info.plist file) I created the bridging file (at this point still compiles without errors) then I import the headers in my bridging file:

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

and now I get the following errors:

Could not build module FBSDKCoreKit
Could not build module FBSDKLoginKit

as well as

Failed to import Bridging Header

Things I have tried so far:

  1. The FB libraries are linked.

  2. I checked that the Objective-C Bridging Header has the correct path to my bridging header path.

  3. Changed the "Always Search User Paths" key from build settings->search paths to yes.

  4. I set the "User Header Search Paths" to my project root path.

I have also tried solutions to similar questions I have found but nothing worked and now I am really stuck.

Any help would be greatly appreciated!

EDIT:

Still didn't manage to solve this problem but I might have found a way to work around it. In the stated case I was using the fb sdk for iOS until I found one specific for Swift which I installed using cocoapods. (and, yes it works now)

Here's the link for it.

KeykoYume
  • 2,497
  • 6
  • 24
  • 48
  • You should follow this [tutorial](https://developers.facebook.com/docs/facebook-login/ios) directly from FB developper's page – Bogy Oct 26 '16 at 15:39

1 Answers1

0

Have you tried the "copy files if needed" option? This will copy the needed files into your folder and there will no be need to play with the paths. Also make sure you have the bolts.framework installed, that worked for me.

i6x86
  • 1,557
  • 6
  • 23
  • 42
  • Yes, that's what I did – KeykoYume Oct 27 '16 at 08:27
  • I tried installing bolts using pod but it still doesn't work. I am getting that the bridging file could not be found – KeykoYume Oct 27 '16 at 14:17
  • in Targets (yourProject)/ Buid Settings / Swift Compiler General must be the project-Bridging-Header.h, do you have this one there? – i6x86 Oct 27 '16 at 14:48
  • have you tried this one http://stackoverflow.com/questions/24146677/swift-bridging-header-import-issue ? – i6x86 Oct 27 '16 at 14:50
  • yes, I have correctly put my bridging file path as $(PROJECT_DIR)/projectname/Bridging-Header.h (checked it so many times). I have also set the "Install Objective-C Compatibility Header" to yes (as I have read in other stackoverflow solutions) I have also tried the solutions in the question you mentioned but without success. The thing that I find weird is that my project compiles with the bridging file as long as i don't have the import FBSDKCoreKit in it. As soon as I add it, it says it can't find the bridging file – KeykoYume Oct 27 '16 at 17:03
  • as Bogy mentioned previously, you have to give a try to the facebook tutorial, except for the part they tell you not to copy items if needed. do it and tell us if it works for you. good luck! – i6x86 Oct 27 '16 at 17:10