ios - 使用集成 facebook SDK 归档 ios 应用程序时出现链接器错误

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

  • 我有一个 swift 的 IOS 应用程序,运行良好。
  • 我已将 Facebook SDK 集成到我的应用程序中,并且常见测试运行良好。我可以在 iPad 和模拟器中运行该应用
  • 我在构建应用程序期间遇到了第一个链接错误。我通过将 FacebookSDK 框架的路径添加到“build设置”中的“框架搜索路径”解决了这个问题。
  • 我的框架已添加到项目中以进行链接:

enter image description here

到目前为止一切顺利,但是: 当存档应用程序以在苹果商店提交时,我收到链接器错误。我已经清理了该项目并重建了它的工作原理。还分析了该应用程序的工作原理。只有归档才会抛出错误:

Ld /Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/WHatl.build/Objects-normal/armv7/WHatl normal armv7
    cd /Users/user/Desktop/Prototypes
    export IPHONEOS_DEPLOYMENT_TARGET=8.1
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -L/Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/BuildProductsPath/Release-iphoneos -F/Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/BuildProductsPath/Release-iphoneos -F/Users/user/Documents/FacebookSDKs-iOS-4 -filelist /Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/WHatl.build/Objects-normal/armv7/WHatl.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.1 -dead_strip -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/BuildProductsPath/Release-iphoneos -fobjc-arc -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/WHatl.build/Objects-normal/armv7/WHatl.swiftmodule -lz -framework FBSDKCoreKit -framework FBSDKShareKit -framework FBSDKLoginKit -lsqlite3 -Xlinker -dependency_info -Xlinker /Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/WHatl.build/Objects-normal/armv7/WHatl_dependency_info.dat -o /Users/user/Library/Developer/Xcode/DerivedData/myapp-ezoabbyxtblpfughttvlaqtuxxeb/Build/Intermediates/ArchiveIntermediates/WORLDHISTORY_ATLAS/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/WHatl.build/Objects-normal/armv7/WHatl

ld: warning: Auto-Linking supplied '/Users/user/Documents/FacebookSDKs-iOS-4/Bolts.framework/Bolts', framework linker option at /Users/user/Documents/FacebookSDKs-iOS-4/Bolts.framework/Bolts is not a dylib
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)

有什么提示吗?如何分析?

更新

像其他 3 个框架一样,我还添加了 Bolts.framework。该应用程序仍然可以在模拟器和设备上构建和运行,但存档仍然会抛出错误,但错误不同:

clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)

有什么帮助吗?

更新2

我想我已经解决了这个问题。我在build设置中将“启用位码”修改为“否”。但我不知道这个变化会产生什么影响。 有人知道吗?

最佳答案

尝试以下步骤: 选择 Xcode -> 转到窗口选项 -> 选择项目 -> 删除派生数据 -> 退出 Xcode -> 再次运行应用程序 -> 存档应用程序

关于ios - 使用集成 facebook SDK 归档 ios 应用程序时出现链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37772334/

相关文章:

swift - 以一定的速度在屏幕上移动一个对象。(Sprite Kit)

ios - 制作具有功能的独立类并在 InterfaceController 类中使用它

ios - UIPageViewController页面里面的UIScrollView滚动问题

ios - 如何修复无法重现的应用程序崩溃?附上崩溃报告和控制台日志

swift - 在主项目中找不到链接到 Cocoapod 的静态框架

ios - CocoaPods 安装库中出现 'auto property synthesis' 错误

ios - showsReorderControl 有什么意义?

c - 通过gcc命令行进行C编译时出现问题

ios - Xcode 8 更新后,通过桥接 header 的 .c 文件不起作用

c++ - 什么是 undefined reference /未解析的外部符号错误以及如何修复它?