Reputation: 441
I am trying to add the Facebook login feature using FBSDKCoreKit
and FBSDKLogin
. When I try to import these two framework to my AppDelegate
file, it shows error which is
"No such module 'FBSDKCoreKit'".
I changed Allow Non-modular Includes In Framework Modules
from NO
to YES
, but the error is still there.
I need help with coming up with a solution to resolve the error.
Upvotes: 10
Views: 26456
Reputation: 905
Please try opening the project using .xcworkspce not with .xcodeproj As workspace load all the depencies.
Upvotes: 3
Reputation: 169
if you are using pods then just delete all pod file and related folders and start from the first step
init pod
.
then open that pod file and add following framework
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
then pod install
and import it to the swift file and enjoy :)
and if you are directly add folder to your project then make sure that 'copy if needed' is marked
Upvotes: 4
Reputation: 3138
This fixed it for me: Make sure to Clean and Build your project after running the Pod Install.
From menu: Product/ clean & then build.
Upvotes: 0
Reputation: 12198
I resolved No such module 'FrameworkName'
issue with following steps:
1) Create a group, call it Framework
(optional, best practice)
2) Drag desired SDK(s) from Original SDK path to Framework
, in your case FBSDKCoreKit
and FBSDKLoginKit
3) When the dialog pops 'Choose options for adding these files:', choose following:
Additional step for Facebook SDK version 4.0:
4) Select the target in the project editor and click Build Settings, change Framework Search Paths to: ~/Documents/FacebookSDKDirectoryName
Upvotes: 8
Reputation: 625
In AppDelegate import:
import FacebookCore
import FacebookLogin
and add:
func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
SDKApplicationDelegate.shared.application(application,
didFinishLaunchingWithOptions: launchOptions)
return true
}
func application(_ app: UIApplication, open url: URL, options:
[UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
return SDKApplicationDelegate.shared.application(app, open: url,
options: options)
}
Upvotes: 0
Reputation: 625
Looks like you also have to add to the Bridging-Header.h file:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
#import <FBSDKShareKit/FBSDKShareKit.h>
The use of Bridging-Header.h is only needed when you use the Objective-C version of the framework files. However, the Swift tutorials on the Facebook site do leave out key steps for using the Swift-built framework files, specifically the AppDelegate adjustments after importing FBSDKCoreKit there.
Upvotes: 0
Reputation: 19
What fixed it for me was removing the pods folder and running the install command again:
rm -Rf Pods
pod install
Upvotes: 1
Reputation: 2638
I have solved this problem by typing import FBSDKLoginKit
Dont copy!! just write.
Hope it Helps
Upvotes: 0
Reputation: 57
I'd like to suggest one of the easiest way.
Dada! Works like a charm!
Upvotes: 2
Reputation: 1060
I have solved this problem by copying the frameworks to the application's folder. Your application does not know the path of the frameworks.
Upvotes: 0
Reputation: 222
I resolved this problem by adding FacebookSDK
Directory path to the "Framework Search Paths"
Go to Build Settings and search for "framework search"
Upvotes: 13
Reputation: 5891
It's the usual suspects.
Check your Frameworks folder. Check Project -> Build Phases -> Link Binary with Libraries, and make sure FBSDKCoreKit
and FBSDKLoginKit
are included.
If they're there, and the error still exists, tap on each framework, and make sure Target Membership
is checked under File inspector.
Upvotes: 1