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

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


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'.

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.


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


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.