SWIFT中IOS App的FacebookSDK集成链接器错误

时间:2016-06-12 06:49:10

标签: ios swift linker-errors facebook-sdk-4.0

  • 我有一个在swift中实现的IOS应用
  • 我想整合facebooksdk。为此,我按照Facebook开发人员指南中的步骤将sdk添加到我的项目中:
  

从Facebook SDK文件夹中,拖动文件夹FBSDKCoreKit.Framework,   FBSDKLoginKit.Framework,FBSDKShareKit.Framework到您的Xcode   Projects Framework文件夹。

我还遵循以下步骤,我猜这与我的问题无关。

实际上,我可以在项目中看到3个框架:

enter image description here

但是我无法导入FBSDKCoreKit(没有这样的模块),我也遇到了链接器错误:

ld:找不到框架FBSDKCoreKit

请参阅下面的详细错误。

我不知道如何分析这个问题。任何提示?

详细错误:

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)

1 个答案:

答案 0 :(得分:1)

抱歉浪费你的时间。 我自己发现了它。

我刚刚添加了框架的路径: 目标 - >构建设置 - >框架搜索路径 - > “/用户/用户/文档/ FacebookSDKs-IOS-4”