Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook iOS SDK v 4.1.0 in Swift with Cocoapods: cannot import modules

I tried to update my Swift project to Facebook SDK v 4.1.0 today (FBSDKCoreKit and FBSDKLoginKit), but it doesn't seem to be working. I cannot import the modules as they are not found.

I basically removed the line

pod 'Facebook-iOS-SDK'

and added the lines

pod 'FBSDKCoreKit'

pod 'FBSDKLoginKit'

and then did a pod install. The Facebook doc says the new SDK supports direct imports, so I tried

import FBSDKCoreKit

in one of my project files, but it says No such module 'FBSDKCoreKit'

I looked around and found the following links which talk about bug with building module, and the Facebook bug report and changelog:

issue using FBSDK in swift iOS application

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

https://developers.facebook.com/docs/ios/change-log-4.x

However, it seems to claim that the issue has been fixed in v 4.1.0 (seems to be the main reason for the update), so this isn't the problem in my case? Anyone have any information about this / have a solution?

like image 236
wllychng Avatar asked May 08 '15 06:05

wllychng


1 Answers

Try adding use_frameworks! to the top of your podfile, as suggested by this answer. Here's a blogpost that explains the issue.

like image 84
blwinters Avatar answered Oct 14 '22 18:10

blwinters