Pregunta

I know this has been covered quite a lot, but I've been googling and trying things for almost 2 days straight now with no luck from the current solutions.

I'm using XCode 4.6.2 to create a PhoneGap application, which currently builds to a device and simulator no problem. However, when I try to archive the file, I get the error message:

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

It also lists every file in my www folder that I'm trying to compile as follows:

chown: /my/folder/path/appName.app/www/filename.abc: Operation not permitted

I've tried setting the "Build Active Architecture Only" to yes, for both the main project and the included PhoneGap project.

I've tried combinations of different architectures. Currently removed armv6 & armv7s. Only armv7 remains at the moment.

It seems like a permission problem, but I've gone in via the terminal and doubly made sure I have full rights to the folder. I'm using the main admin user account.

I did notice however, that when I go to the terminal and type:

sudo chown -R userName /path

I get the exact same error as xcode produces.

It's my first experience using a Mac in general, let alone xcode, so there might be something fundamental that I'm missing too.

I opened up a hello world app to try archiving it, and that worked without any problem.

I've tried the small things like cleaning and rebooting.

Thank you.

¿Fue útil?

Solución 2

Have you developed some of your Phone Gap app on a Windows machine? You may need to set your files be not read only on your Windows machine before you copy them to your Mac.

Otros consejos

This problem is caused because some of your files (the ones that throw the chmod in xcode) don't have the proper owner/group set. They probably are set with root permissions, which can be caused by installing e.g. PhoneGap modules with sudo.

Run a sudo chown -R username:staff YourAppFolder command on your original files and you will be able to archive your code again.

If you are encountering the errors above with some files, probably it's because Xcode is tryng to chown the .app created and it can't change the permissions of some files.

If you read the log of the errors, in the previous lines you wull see that there is a line starting with chown [....] .app

  1. copy that line
  2. open the terminal
  3. type: sudo [paste the line copied]
  4. insert your admin password
  5. Archive again.

It fixed for me.

(Same thing if you have chmod errors)

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top