简体   繁体   English

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

[英]Linker Error with FacebookSDK integration for IOS App in SWIFT

  • I have an IOS app implemented in swift 我有一个迅速实施的IOS应用程序
  • I want to integrate facebooksdk. 我想整合facebooksdk。 For this I followed the steps from facebook developer guide and added the sdk to my project: 为此,我遵循了Facebook开发人员指南中的步骤,并将sdk添加到了我的项目中:

From the Facebook SDK folder, drag the folder FBSDKCoreKit.Framework, FBSDKLoginKit.Framework, FBSDKShareKit.Framework into your Xcode Projects Framework folder. 从Facebook SDK文件夹中,将文件夹FBSDKCoreKit.Framework,FBSDKLoginKit.Framework,FBSDKShareKit.Framework拖到Xcode Projects Framework文件夹中。

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: 我实际上可以在我的项目中看到3个框架:

在此处输入图片说明

but I can't import FBSDKCoreKit (no such module) and I get also an linker error: 但是我不能导入FBSDKCoreKit(没有这样的模块),并且我也得到一个链接器错误:

ld: framework not found FBSDKCoreKit ld:找不到框架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" 我只是在以下路径中向框架添加了路径:目标->构建设置->框架搜索路径->“ / Users / user / Documents / FacebookSDKs-iOS-4”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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