Xcode 7.2 ld:无法打开输出文件进行写入

时间:2016-03-06 22:21:53

标签: ios xcode

我试图将我的应用程序归档为通用iOS设备,并且它一直失败并出现以下错误:

Ld /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/IntermediateBuildFilesPath/NavCompass.build/Release-iphoneos/NavCompass.build/Objects-normal/arm64/NavCompass normal arm64
    cd /Users/wesleyarchbell/stuff/code/ios/NavCompass
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -L/Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/BuildProductsPath/Release-iphoneos -F/Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/BuildProductsPath/Release-iphoneos -filelist /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/IntermediateBuildFilesPath/NavCompass.build/Release-iphoneos/NavCompass.build/Objects-normal/arm64/NavCompass.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=8.0 -dead_strip -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/BuildProductsPath/Release-iphoneos -framework InAppSettingsKit -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/IntermediateBuildFilesPath/NavCompass.build/Release-iphoneos/NavCompass.build/Objects-normal/arm64/NavCompass.swiftmodule -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreLocation -framework AVFoundation -framework MessageUI -framework Pods_NavCompass -Xlinker -dependency_info -Xlinker /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/IntermediateBuildFilesPath/NavCompass.build/Release-iphoneos/NavCompass.build/Objects-normal/arm64/NavCompass_dependency_info.dat -o /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/IntermediateBuildFilesPath/NavCompass.build/Release-iphoneos/NavCompass.build/Objects-normal/arm64/NavCompass

ld: can't open output file for writing: /Users/wesleyarchbell/Library/Developer/Xcode/DerivedData/NavCompass-avlrykxtubzibmfzdvzyuyjcysoo/Build/Intermediates/ArchiveIntermediates/NavCompass/IntermediateBuildFilesPath/NavCompass.build/Release-iphoneos/NavCompass.build/Objects-normal/arm64/NavCompass, errno=21 for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

只有在我将Xcode更新到最新版本时才会出现此问题。我一直在撞墙而没有解决方案:(

2 个答案:

答案 0 :(得分:2)

我在Xcode 7.2.1中重新创建项目,并将文件迁移到该项目,修复了问题,我现在能够成功存档。

答案 1 :(得分:1)

尝试删除位于~/Library/Developer/Xcode

的DerivedData文件夹