Cannot find module FBSDKCoreKit Cocoapods

和自甴很熟 提交于 2019-12-04 11:08:06

For people moving from Carthage to Cocoapods make sure to remove the Carthage references of the FBSDKCoreKit from the Link Binary With Libraries under Build Phases option.

Seems that the facebook pods are Objective-C and they need a special way of importing in a swift project.

This is how I got it to work:

Create a bridging header in your project, if you dont have one(I created a new header file called Bridging-Header.h and set it as a bridging header in the project settings, like in the screenshot)

Then in this file import the facebook modules. Here's how my file looks like:

#ifndef Bridging_Header_h
#define Bridging_Header_h

@import FBSDKCoreKit;
@import FBSDKLoginKit;

#endif /* Bridging_Header_h */

Let me know if this workout for you or you need more help.

I fixed this by

  1. Removing the Bridging Header. Facebook SDK doesn't need them anymore after version 4.1
  2. Adding all of the .frameworks to the Projects Build Phases -> Link Binary With Libraries
  3. Selecting each framework and building it. You can do this by selecting your project name next to the run arrow.
  4. Cleaning the project and restarting my computer.

Please try below steps,

  • Explicitly mention the versions i.e.

pod 'FBSDKCoreKit', '~>5.8.0'

pod 'FBSDKShareKit', '~>5.8.0'

pod 'FBSDKLoginKit', '~>5.8.0'

  • Update pod repo using sudo pod repo update
  • Update pod using pod update

first add in pod file

 pod 'FacebookCore'
 pod 'FacebookLogin'
 pod 'FacebookShare'

this is facebook swift library,after that before using FBSDKCoreKit,just use FacebookCore then import FBSDKCoreKit

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