【发布时间】:2016-10-12 20:15:11
【问题描述】:
- 我有一个运行良好的 Swift IOS 应用程序。
- 我已将 Facebook SDK 集成到我的应用程序中,并且常用测试运行良好。我可以在我的 iPad 和模拟器中运行该应用程序
- 我在构建应用程序时遇到了第一个链接错误。我通过将 FacebookSDK 框架的路径添加到“构建设置”中的“框架搜索路径”解决了这个问题。
- 我的框架已添加到项目中以进行链接:
到目前为止一切都很好,但是: 归档应用程序以在 Apple Store 中提交时,出现链接器错误。我已经清理了项目并重建了它的工作。分析应用程序也有效。只有归档会引发错误:
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)
任何提示?如何分析?
更新
我还添加了 Bolts.framework,就像其他 3 个框架一样。该应用程序仍然可以在模拟器和设备上构建和运行,但存档仍然会引发错误,但会出现不同的错误:
clang: error: unable to execute command: Segmentation fault: 11
clang: error: linker command failed due to signal (use -v to see invocation)
有什么帮助吗?
更新 2
我想我解决了这个问题。我在构建设置中将“启用位码”修改为“否”。但我不知道这种变化会产生什么影响。 有谁知道吗?
【问题讨论】:
-
您是否尝试过删除项目的派生数据?
标签: ios swift linker-errors facebook-sdk-4.0