Xcode 7.2 ld:不能打开输出文件进行写入。

时间:2021-02-14 20:52:15

Im trying to archive my application for Generic iOS device and it keeps failing with the following error:

我试图将我的应用程序存档,用于通用的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)

This issue only started occurring when I updated Xcode to the latest version. Ive been banging my head against the wall with no solution :(

当我更新Xcode到最新版本时,这个问题才开始出现。我一直把头靠在墙上,没有办法。

2 个解决方案

#1


2  

I landed up re-creating the project in Xcode 7.2.1 and migrated the files over to that project, that fixed the issue and I am able to now Archive successfully.

我在Xcode 7.2.1中重新创建了这个项目,并将文件迁移到那个项目,修复了这个问题,现在我可以成功地归档了。

#2


1  

Try deleting your DerivedData folder, located at ~/Library/Developer/Xcode

尝试删除您的DerivedData文件夹,位于~/Library/Developer/Xcode中。

#1


2  

I landed up re-creating the project in Xcode 7.2.1 and migrated the files over to that project, that fixed the issue and I am able to now Archive successfully.

我在Xcode 7.2.1中重新创建了这个项目,并将文件迁移到那个项目,修复了这个问题,现在我可以成功地归档了。

#2


1  

Try deleting your DerivedData folder, located at ~/Library/Developer/Xcode

尝试删除您的DerivedData文件夹,位于~/Library/Developer/Xcode中。