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

37,034

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

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.

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.

Source

Share:
37,034
Admin
Author by

Admin

Updated on July 08, 2022

Comments

  • Admin
    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_
    duality_ over 11 years
    To 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
    tschoffelen over 11 years
    Also 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
    SteveB about 11 years
    Rebooting was the only thing that fixed it for me as well.
  • Phil
    Phil about 11 years
    thanks 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
    ort11 over 10 years
    If in a corporate environment this can happen and this posting fixes it. Top notch.
  • funroll
    funroll about 10 years
    Normally 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
    Moonwalker over 9 years
    yes indeed. After trying a few other things this was the problem solver.
  • C0D3
    C0D3 about 7 years
    Doesn't fix it.
  • Evan R
    Evan R about 7 years
    This 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 and Alternate 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
    user2900761 over 6 years
    I had the similar issue. This helped like a charm.
  • Daniel Smith
    Daniel Smith almost 5 years
    I'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
    Bill Norman over 4 years
    Xcode 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.