"Command /usr/sbin/chown failed with exit code 1" when Archiving
Solution 1
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.
Edit: this is still working as of July 2018 for folks. Edit: this is still working as of January 2019 xcode 9.4.1
Solution 2
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'.
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.
The screenshot above shows - I just blanked out Install Owner/Group, and that did it.
Solution 3
When I got this error, rebooting my computer fixed it.
Solution 4
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.
Solution 5
None of the other solutions worked for me on Xcode 4.5. What I had to do was the following:
The fix is by removing the armv6 architecture from both your project and the CordovaLib project, clean both projects, and rebuild.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on July 08, 2022Comments
-
Admin almost 2 years
I am trying to archive my first iOS 4.3 Application for iPhone and I always encounter this error:
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'.
-
duality_ over 11 yearsTo elaborate these steps: in Xcode, click on your project, go to Build Settings tab, under Architectures there must be only armv7 written. Do the same for the CordovaLib project (it's in the left pane, the same as your project). Than clean both projects using Product -> Clean. This worked for me also, fixed my problem.
-
tschoffelen over 11 yearsAlso make sure that when you have any subprojects/libraries in your project (i.e. CordovaLib), to also blank out the Install Owner/Group there.
-
SteveB about 11 yearsRebooting was the only thing that fixed it for me as well.
-
Phil about 11 yearsthanks this was exactly what I needed! But Im wondering why I need this. Yesterday it worked, today not. Of course I had also to blank out the Install Permissions
-
ort11 over 10 yearsIf in a corporate environment this can happen and this posting fixes it. Top notch.
-
funroll about 10 yearsNormally I wouldn't think doing this step should be necessary, but it does fix the problem. I've come back to this answer a couple times.
-
Moonwalker over 9 yearsyes indeed. After trying a few other things this was the problem solver.
-
C0D3 about 7 yearsDoesn't fix it.
-
Evan R about 7 yearsThis is a bug with Xcode (still going strong in 8, apparently!)—in my case, it had incorrect values from another project I had open in the
Install Owner
andAlternate Install Owner
fields. As others have said, quitting Xcode, restarting it, and doing the clean and clean build folders procedures fixed it for me. -
user2900761 over 6 yearsI had the similar issue. This helped like a charm.
-
Daniel Smith almost 5 yearsI'm not sure how many times I've come here to find this answer but based on my browser history this appears to be the 3rd time. This still works in 10.2.1. If someone wants to actually fix this, my issue is that chown fails because my company is using AD group names like "CORP\Domain Users" which is not a valid name.
-
Bill Norman over 4 yearsXcode 11.3.1, still works. However, with a twist. I had no problem when I was using my MacBook at work, but would get this error when I tried to archive while at home. BUT-- it would then work fine if I VPN'd to our work server from home. Very weird.