ios 存档时“命令 /usr/sbin/chown 失败,退出代码为 1”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7018783/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:03:24  来源:igfitidea点击:

"Command /usr/sbin/chown failed with exit code 1" when Archiving

iosxcodechown

提问by Justin

I am trying to archive my first iOS 4.3 Application for iPhone and I always encounter this error:

我正在尝试为 iPhone 归档我的第一个 iOS 4.3 应用程序,但我总是遇到此错误:

Command /usr/sbin/chown failed with exit code 1

I have searched through various forums, trying solutions such as changing the Alternate Install Group (which I don't know what to change to), and turning on 'Skip Install'.

我搜索了各种论坛,尝试了诸如更改备用安装组(我不知道要更改为什么)和打开“跳过安装”等解决方案。

回答by Dan

As dumb as it sounds, in XCode 5.1.1, all I had to do was quit out and restart XCode just now. I know it's not much of an "answer" but it just worked for me.

听起来很愚蠢,在 XCode 5.1.1 中,我所要做的就是退出并重新启动 XCode。我知道这不是一个“答案”,但它对我有用。

Edit: this is still working as of July 2018 for folks. Edit: this is still working as of January 2019 xcode 9.4.1

编辑:截至 2018 年 7 月,这对人们仍然有效。编辑:截至 2019 年 1 月,这仍然有效 xcode 9.4.1

回答by adalle

enter image description here

在此处输入图片说明

I was having difficulty with the SetOwnerAndGroup part of Archiving - I was getting /usr/sbin/chown failed, and it was getting 'operation not permitted' on each file it tried to 'chown'.

我在存档的 SetOwnerAndGroup 部分遇到了困难 - 我让 /usr/sbin/chown 失败,并且在它试图“chown”的每个文件上都得到“不允许操作”。

This was easily tested in the terminal - 'chown' doesn't work, but 'sudo chown' does. Since I had no need to be changing file permissions, the simplest solution was to not do the chown.

这在终端中很容易测试 - 'chown' 不起作用,但 'sudo chown' 可以。由于我不需要更改文件权限,因此最简单的解决方案是不执行 chown。

The screenshot above shows - I just blanked out Install Owner/Group, and that did it.

上面的屏幕截图显示 - 我只是清空了安装所有者/组,并且做到了。

回答by dl.

When I got this error, rebooting my computer fixed it.

当我收到此错误时,重新启动计算机修复了它。

回答by Spyros El.

I have tried all the other solutions but none of them worked for me. So I have run this on a terminal to change the owner to me on every file in my project:

我已经尝试了所有其他解决方案,但没有一个对我有用。因此,我在终端上运行此命令以将项目中每个文件的所有者更改为我:

sudo chown -R my_username:my_group ./my_project_folder

where "my_username" is you username, "my_group" is your group (this is usually staff) and "my_project_folder" your project's folder.

其中“my_username”是您的用户名,“my_group”是您的组(通常是员工),“my_project_folder”是您的项目文件夹。

回答by Bashevis

None of the other solutions worked for me on Xcode 4.5. What I had to do was the following:

在 Xcode 4.5 上,没有其他解决方案对我有用。我必须做的是以下内容:

The fix is by removing the armv6 architecture from both your project and the CordovaLib project, clean both projects, and rebuild.

修复方法是从您的项目和 CordovaLib 项目中删除 armv6 架构,清理两个项目,然后重新构建。

Source

来源

回答by Helder Robalo

To it works in my environment I cleaned all information about permission, as +adalle said, complemented by Tomand Phil

为了它在我的环境中工作,我清除了所有有关许可的信息,正如 + adalle 所说,由TomPhil补充

I emptiedthe fields Install Group, Install Owner, Install Permissionincluding the Cordova SubProject

清空安装组安装所有者安装权限,包括Cordova 子项目

回答by Kishor

enter image description hereI had the same issue with Xcode . It started working after restarting Xcode. In the screenshot , Xcode ->build settings , installed group was empty after restarting Xcode .the group id it has showed as some number.

在此处输入图片说明我对 Xcode 有同样的问题。它在重新启动 Xcode 后开始工作。在截图中,Xcode ->build settings,重新启动 Xcode 后安装的组是空的。组 id 显示为某个数字。

回答by Thafer Shahin

For me reboot my mac fixed it. OS High Sierra, xCode 9.2

对我来说,重新启动我的 mac 修复了它。操作系统 High Sierra,xCode 9.2

回答by funroll

  1. Select the target that's giving you the error
  2. Change Build Active Architecture Onlyfrom Yes to No
  1. 选择给你错误的目标
  2. Build Active Architecture Only从是更改为否

That worked for me.

那对我有用。

回答by Vladimir Tkachenko

I tried all possible variants and they didn't help me. So I downloaded old XCode 4.4.1 and voila - application archived successfully :)

我尝试了所有可能的变体,但他们没有帮助我。所以我下载了旧的 XCode 4.4.1,瞧 - 应用程序存档成功:)