简体   繁体   中英

Linker Error with FacebookSDK integration for IOS App in SWIFT

  • I have an IOS app implemented in swift
  • I want to integrate facebooksdk. For this I followed the steps from facebook developer guide and added the sdk to my project:

From the Facebook SDK folder, drag the folder FBSDKCoreKit.Framework, FBSDKLoginKit.Framework, FBSDKShareKit.Framework into your Xcode Projects Framework folder.

I also followed the following steps, which I guess are not related to my problem.

I actually I can see the 3 frameworks in my project:

在此处输入图片说明

but I can't import FBSDKCoreKit (no such module) and I get also an linker error:

ld: framework not found FBSDKCoreKit

See detailed error below.

I don't know how to analyse this problem. Any hints ?

Detailed Error:

Ld /Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Products/Debug-iphonesimulator/Chronica.app/Chronica normal x86_64
    cd /Users/user/Desktop/Prototypes
    export IPHONEOS_DEPLOYMENT_TARGET=8.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/Chronica.build/Debug-iphonesimulator/Chronica.build/Objects-normal/x86_64/Chronica.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.1 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/Chronica.build/Debug-iphonesimulator/Chronica.build/Objects-normal/x86_64/Chronica.swiftmodule -lz -framework FBSDKCoreKit -framework FBSDKShareKit -framework FBSDKLoginKit -lsqlite3 -Xlinker -dependency_info -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/Chronica.build/Debug-iphonesimulator/Chronica.build/Objects-normal/x86_64/Chronica_dependency_info.dat -o /Users/user/Library/Developer/Xcode/DerivedData/Chronica-ezoabbyxtblpfughttvlaqtuxxeb/Build/Products/Debug-iphonesimulator/Chronica.app/Chronica

ld: framework not found FBSDKCoreKit
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Sorry for wasting your time. I found it luckely by myself.

I just added the path to the frameworks in : Target -> Build Settings -> Framework Search Paths -> "/Users/user/Documents/FacebookSDKs-iOS-4"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM