Xcode 8无法归档“Command / usr / bin / codesign失败,退出代码为1”。 [英] Xcode 8 can't archive "Command /usr/bin/codesign failed with exit code 1"

查看:319
本文介绍了Xcode 8无法归档“Command / usr / bin / codesign失败,退出代码为1”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在macOS Sierra上的Xcode 8上遇到了严重的问题。
当我尝试构建我的应用时,我遇到以下问题。

I've got a serious problem on Xcode 8 on macOS Sierra. when I try to build my app, I get the following issue.

CodeSign /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app
cd /Users/me/Desktop/MyAppFolder1/MyAppFolder2/MyAppxcode
export CODESIGN_ALLOCATE=/Users/me/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Users/me/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/me/Downloads/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "-"

/usr/bin/codesign --force --sign - --timestamp=none /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app

/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1

然后我确实 https://forums.developer.apple.com/thread / 48905 在终端中如下并且有效。但是一旦我清理,问题就会回来。

then I did https://forums.developer.apple.com/thread/48905 in the terminal as the following and it worked. but once I clean, the issue comes back.

cd /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Products/Debug-iphonesimulator/MyApp

ls -al@ *

xattr -c *

此解决方案不适用于存档,但存在以下问题。是有它的任何解决方案?

and this solution doesn't work for archive with the following issue. is there any solution for it?

CodeSign /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app
cd /Users/me/Desktop/MyAppFolder1/MyAppFolder2/MyAppxcode
export CODESIGN_ALLOCATE=/Users/me/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
export PATH="/Users/me/Downloads/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/me/Downloads/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

Signing Identity:     "iPhone Developer: My Name (**********)"
Provisioning Profile: "iOS Team Provisioning Profile: com.**********.*********"
                  (********-****-****-****-************)

/usr/bin/codesign --force --sign **************************************** --entitlements /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/IntermediateBuildFilesPath/MyApp.build/Release-iphoneos/MyApp.build/MyApp.app.xcent --timestamp=none /Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app

/Users/me/Library/Developer/Xcode/DerivedData/MyApp-gnoiiwnelmxzdidnijaswisrwdqe/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app: resource fork, Finder information, or similar detritus not allowed
Command /usr/bin/codesign failed with exit code 1


推荐答案

我在Apple论坛找到了这个解决方案

I found this solution in the Apple forum

cd ~/Library/Developer/Xcode/DerivedData
xattr -rc .

xattr -rc ~/Library/Developer/Xcode/DerivedData

这篇关于Xcode 8无法归档“Command / usr / bin / codesign失败,退出代码为1”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆