尝试归档 Xcode 项目时出错

Posted

技术标签:

【中文标题】尝试归档 Xcode 项目时出错【英文标题】:Error while trying to Archive an Xcode project 【发布时间】:2014-10-15 00:37:45 【问题描述】:

大家晚上好!!

我有一个想要在 App Store 上发布的 xcode 项目。它在外部设备上正常构建和运行,但是当我尝试存档时,出现以下错误:

Ld /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/InstallationBuildProductsLocation/Applications/MinhaBibliaOffline.app/MinhaBibliaOffline normal armv7
cd /Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/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/iPhoneOS8.0.sdk -L/Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/BuildProductsPath/Release-iphoneos -L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Debug-iphoneos -L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Release-iphoneos -F/Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/BuildProductsPath/Release-iphoneos -filelist /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/IntermediateBuildFilesPath/MinhaBibliaOffline.build/Release-iphoneos/MinhaBibliaOffline.build/Objects-normal/armv7/MinhaBibliaOffline.LinkFileList -dead_strip -ObjC -lPods-AFNetworking -lPods-MMDrawerController -lPods-WYPopoverController -framework CoreGraphics -framework MobileCoreServices -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=7.0 -lsqlite3 -framework CoreGraphics -framework UIKit -framework Foundation -lPods-MinhaBibliaOffline -Xlinker -dependency_info -Xlinker /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/IntermediateBuildFilesPath/MinhaBibliaOffline.build/Release-iphoneos/MinhaBibliaOffline.build/Objects-normal/armv7/MinhaBibliaOffline_dependency_info.dat -o /Users/Dado/Library/Developer/Xcode/DerivedData/MinhaBibliaOffline-bmkcjpxbesptrhdhnfhpudwgicip/Build/Intermediates/ArchiveIntermediates/MinhaBibliaOffline/InstallationBuildProductsLocation/Applications/MinhaBibliaOffline.app/MinhaBibliaOffline

ld: warning: directory not found for option '-L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Debug-iphoneos'
ld: warning: directory not found for option '-L/Users/Dado/Dropbox/Sistema/MyWorkspace/Apple/MinhaBibliaOffline/Pods/build/Release-iphoneos'
ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是我的 Podfile 实现

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, "7.0"

target "MinhaBibliaOffline" do

pod "AFNetworking"
pod "MMDrawerController", "~> 0.5.7"
pod "TAOOverlayHelp"
pod "WYPopoverController", "~> 0.2.2"

end

我已经找了几个小时的解决方案,但仍然没有找到一个有效的解决方案

【问题讨论】:

看起来您没有正确链接您的 AFNEnetworking pod?但是你的代码会编译并运行,所以我猜你没有使用 AFNetworking 包,但你仍然将它包含在你的 podfile 中? 我刚刚将 podfile 添加到问题中,我错过了什么吗? 我也有同样的问题。它在进行正常构建时有效,但在尝试归档时失败。 【参考方案1】:

我刚刚找到了一个对我有用的答案。我会写在下面,因为它可能对某人有用。

就我而言,我必须在我的项目目标 > 构建设置中更新“其他链接器标志”。

对通过 CocoaPods 添加的项目有错误的引用:

例如: 之前:-l"Pods-AFNetworking" 我改为:-l"Pods-MinhaBibliaOffline-AFNetworking"

希望这个回答对你有帮助

干杯

【讨论】:

以上是关于尝试归档 Xcode 项目时出错的主要内容,如果未能解决你的问题,请参考以下文章

命令 /usr/sbin/chown 失败,退出代码为 1 归档时出错

归档有关符号链接的 iOS 项目时出错

当我尝试使用位码导出即席时出错

Xcode 7 尝试使用库归档 ios 应用程序

归档 Xcode 项目以供提交

尝试在 XCode 4.1 中重构重命名时出错