Command /usr/sbin/chown failed with exit code 1? - iphone

Each time I try to archive my application to submit it to apple Xcode keeps giving me this error! I'v Triple checked that in the Cocos2d libraries Target i made that my Install Group & Install Owner are correct and i;v restarted my computer & reinstalled Xcode. It runs just fine in the simulator. But like i said as soon as I hit Archive it gives me this error
SetOwnerAndGroup "Home:staff" "/Users/Home/Library/Developer/Xcode/DerivedData/Swimmu-bdswkmmaijgxvyasdnmkpmnfgxji/ArchiveIntermediates/Swimmu/InstallationBuildProductsLocation/usr/local/lib/libcocos2d libraries.a"
cd /Users/Home/Documents/Swimmu
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/sbin/chown -RH "Home:staff" "/Users/Home/Library/Developer/Xcode/DerivedData/Swimmu-bdswkmmaijgxvyasdnmkpmnfgxji/ArchiveIntermediates/Swimmu/InstallationBuildProductsLocation/usr/local/lib/libcocos2d libraries.a"
chown: /Users/Home/Library/Developer/Xcode/DerivedData/Swimmu-bdswkmmaijgxvyasdnmkpmnfgxji/ArchiveIntermediates/Swimmu/InstallationBuildProductsLocation/usr/local/lib/libcocos2d libraries.a: No such file or directory
Command /usr/sbin/chown failed with exit code 1

Yet a third problem with the same error... Different solution as well. In my case, the default install group $(INSTALL_GROUP) was a windows domain and had \ in it, which translated to space and caused the build to fail.. I fixed it by changing my install group to be admin.

Your name entered in Install Owner should match the name of your Mac OS login under which you are logged in and the Name of Apple's Dev License and certificates.
So go to System Preferences | Users & Groups and set a Full name that matches your Apple's Developer License name

"libcocos2d libraries.a"
The problem may be related to the space in the library. If you created that library target it should be easy to fix by changing the name of the library target to "cocos2d_libraries".

I had a different problem than you, but had the same error:
Command /usr/sbin/chown failed with exit code 1
When I created my XCode project, my app name had a space in it, so trying to deploy my app always failed. I was able to fix this by using a Custom Archive Name.
In XCode 4...
Edit the Deployment Scheme
Click on the Archive tab
Then specify an Archive Name that doesn't have spaces in it.

I was able to fix this by cleaning the project, deleting derived data, and restarting Xcode.

Related

Unity3d OSX "Application can't be opened"

I'm using a PC and I've created a build for Mac standalone.
I shared the file with my test user by zipping and emailing the build, but when he tries to run the application he sees this error:
The application "SomeApp.app" can't be opened.
After some searching, I learned that I need to do chmod to open the file. Can anyone tell me how to do that on a Mac?
The zip format doesn't have easy support for Unix-like file permissions, so your transfer process is stripping any permission flags that OSX uses to recognize files within that zip that are supposed to be executable. This can also happen with other file transfer solutions, so it's something to watch out for.
The best solution would be to create an archive which does keep those permissions, such as a tar archive.
Failing that, you can have a Mac user open a terminal and set the permission flag manually:
chmod a+x SomeApp.app/Contents/MacOS/*
(Replace SomeApp.app with whatever your .app folder is named)
I had the same issue, I left an answer here, at the bottom: https://forum.unity.com/threads/mac-build-breaking-when-uploaded-to-storage.1093330/
The problem was not with the .zip, but rather with the build itself. Ran fine on my Mac, did NOT run fine once I uploaded it and downloaded it again (or if anyone else downloaded it).
Edited 12/8/2021, as per EmiOB's suggestion, to add the text of my answer (same as in the link):
This worked for me on 2020.3.16f1:
In the Unity Editor: Build Settings, check the box that lets you make an XCode project (requires having XCode installed, I believe I have Xcode 11)
Open the XCode project
Build
That solved my problem :)

Xcode: Warning: Multiple build commands for output file AND error: unable to open executable ''

I've been reading countless other posts and trying numerous fixes, but nothing has worked for my problem. I'll preface this by saying that I haven't used Xcode on this Macbook in some 2-3 months. This is the only project (out of the 4 or so I've tried) that has this problem. The first thing I did after opening Xcode was I changed the name of the project as well as a .h and .m file. I did all of this through Xcode, not Finder.
Nothing is appearing in the Navigator in red text which would indicate that it can't be found. Here is what I've already tried (many times).
Close/Open Xcode.
Clean both the project and build folder.
Delete Derived Data folder.
Ran a Disk Utility to repair permissions.
Restarted the computer.
Tried different combinations of Code Signing.
Delete App from device.
Searched through project for any duplicate file names.
Here is the warning verbatim:
Warning: Multiple build commands for output file /Users/jinser/Library/Developer/Xcode/DerivedData/Landmarks-bgnzcomxftpffiezmwocaqdydrlj/Build/Products/Debug-iphoneos/Landmarks.app/Landmarks
and here is the error:
GenerateDSYMFile /Users/jinser/Library/Developer/Xcode/DerivedData/Landmarks-bgnzcomxftpffiezmwocaqdydrlj/Build/Products/Debug-iphoneos/Landmarks.app.dSYM /Users/jinser/Library/Developer/Xcode/DerivedData/Landmarks-bgnzcomxftpffiezmwocaqdydrlj/Build/Products/Debug-iphoneos/Landmarks.app/Landmarks
cd "/Users/jinser/Desktop/Kevin/Cocos2D Projects/ARSpaceships"
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/dsymutil /Users/jinser/Library/Developer/Xcode/DerivedData/Landmarks-bgnzcomxftpffiezmwocaqdydrlj/Build/Products/Debug-iphoneos/Landmarks.app/Landmarks -o /Users/jinser/Library/Developer/Xcode/DerivedData/Landmarks-bgnzcomxftpffiezmwocaqdydrlj/Build/Products/Debug-iphoneos/Landmarks.app.dSYM
error: unable to open executable ''
This is Xcode 4.2 on Mac 10.6.8. Please, any advice would be appreciated. I am losing my mind.
Thanks.
So to whoever runs into this problem and all of the other solutions out there do not work for you, make sure you don't have a project folder that shares the same name as the project. For instance, my project is called Landmarks and I had a folder inside the resources also called Landmarks. Once I renamed the folder, all was well.
Not my answer, but LargeGlasses provided the real answer (for me) in a comment, I've formulated it as an answer in its own right because I can't Up Vote the comment.
any two files within your project that have the same name will cause this warning.
In my case, I had an icon with the same name in different subfolders, one was used by the App and the other was part of my help resource located in a different folder. The solution is to just rename one of the two.
All credit and my thanks for this answer to LargeGlasses.

Distribution build - "No such file or directory exists"

While creating an ad-hoc build in Xcode 4, I get an error "Operation couldn't be completed. No such file or direcotry exist" when I select Share in "Organizer - Archive" window. I have also included Entitlements.plist file, even status message also displays the build is successful.
I don't know what the problem is and where am I going wrong. Please suggest.
After downloading XCode 4.3 beta with the IOS 5 SDK, the Organizer function to share and archive stopped working with a cryptic error "No such file or directory found".
It turns out that this is related to having two different versions of codesign_allocate . To fix the problem, do the following in a terminal window.
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin
I've put this on my blog http://blog.dmahajan.net as well.
Did you sign the archived version with your Ad-Hoc profile, if so then select "don't Re-sign" in the share screen drop down.
Guys,
Another thing I found is that if you've developed an app in xcode < xcode4 and you are creating builds in xcode4 then you might get this error.
To resolve this, follow these steps-
1. In Entitlements.plist, add a key- "application-identifier", type- "String", value - "$(AppIdentifierPrefix)$(CFBundleIdentifier)"
Now create an "Archive" build, when the window appears, right click on the app name and "Show in finder".
AppName -> Right Click -> Show Package Contents.
Products -> .app file. Now use this .app file along with the provisioning profile.
This solution worked for me very well.
Another possibility: duplicated keys in your keychain. Solved my problem.

update iphone app "CodeResources file must be a symbolic link"

I tried to update an iphone app, which lies in an other "itunes connect" profile. I used "application loader" and everything is fine until I try to upload the zip file
I get this strange message and cant figure out whats going wrong
"The CodeResources file must be a symbolic link to _CodeSignature/CodeResources"
I opened the bundle and the folder _CodeSignature is there.
I compiled the app with my distribution profile (no problems)
How are you zipping it? I'm betting that FooApp.app/CodeResources is a file, not a symlink.
If you're using command-line "zip", you need to use zip -y -r to preserve the symlink.
Had the same issue with XCode 3.2.5 (new submission interface), and all it took was to:
delete the build folder
clean, and then
build and archive again.
I had the same issue. But then I noticed that I was building in release mode to the simulator, and not a device. When I targeted a device, I got the proper application file, which I then zipped with the iTunes Artwork and submitted without issue.
I had the same issue here but I "fixed" it after I changed the "Deployment Target" from 2.0 to 3.0 in the target I was building and removed the "Architectures" to only armv6 (before I had both armv6 and armv7). Finally I had to put 'No' to 'Build Active Architecture Only'.
I haven't figured out why I keep getting this error for every binary I create. I've followed all the standard procedures (double-checking my project settings, deleting build folders, cleaning all targets, removing and reinstalling certificates and provisioning profiles, creating and installing new certificates and provisioning profiles, repairing disk permissions, etc) but none of them seem to solve the problem.
I think the problem is that my XCode installation is unable to create symbolic links. I might reinstall it (or even OS X) to see if that fixes the issue permanently.
But in the mean time, this works for me. I use terminal to navigate into the binary and run the following commands
rm CodeResources
ln -s _CodeSignature/CodeResources CodeResources
This deletes the invalid CodeResources file and replaces it with the required symbolic link to _CodeSignature/CodeResources.
I just ran across this issue. It turned out, I had two info.plist files in my resources folder (one for the iPhone version and another for the iPad version). Once I took care of that, the issue went away.
Try this on the command line:
cd (to where your project is)
ln -s _CodeSignature/CodeResources CodeResources
I've just had the same problem. Turns out the project file project.pbxproj in Project.xcodeproj had been corrupted while uploading to an SVN server.
My solution was simply to revert to an older revision, which worked fine.
You have to:
1. Enter the AppName.app folder
2. Create a file named CodeResources
3. Open the file with a plain text editor
4. Type in _CodeSignature/CodeResources (The path where the actual CodeResources file is.)
{The app will now know where the CodeResources file is, and will have an account for all the files in the .app folder.}

Problem installing ad-hoc app on iphone: "resources have been modified."

I can install an app on my development iPhone compiled with "Debug" configuration using my Ad Hoc provisioning and everything works OK.
But when I build it using "Release" configuration, iTunes says:
The application XXX was not installed on the iPhone "YYYY" because its resources have been modified.
I've never seen this message before. Does anybody know what it means?
Thanks!
Antonio
We had the same problem during our first Beta. Someone on Windows dug in the xxx.app folder then Explorer created a Thumbs.db file inside and, boom, he got the message "The application XXX was not installed on the iPhone "YYYY" because its resources have been modified." when he tried to install.
He had to remove the app from iTunes, deleted all the Thumbs.db from xxx.app and then it worked.
We finally got rid of the problem. We were trying to include an image for iTunes after creating the build, but when we used this method (http://iosdevelopertips.com/xcode/itunes-icon-for-ad-hoc-distributions.html) everything went smoothly.
Just in case it helps someone: In my case, I copied the .app to a network drive, then to my Win7 computer before dragging into iTunes - then it did not work. When I zipped the .app first before copying, and then unzipped it on the other end - it worked. Of course, I have no real idea why....
Your debug configuration and your release configuration have some important differences, and release is a lot closer to what ad-hoc should look like. So you first need to duplicate the release configuration and make and call your copy "Ad-Hoc", and make sure you use your ad-hoc provisioning profile with it. Then you need to create a new entitlements file. The new version of Xcode has a cool feature where you can build and archive your app into an ipa file that includes your provisioning profile.
How to do all of this is explained here: http://www.tuaw.com/2010/05/23/devsugar-a-better-way-to-share-ad-hoc-builds/
In those instructions, when it tells you to make the entitlements plist file, it says to uncheck get-task-allow in the plist file. When I created the entitlements file, there wasn't a get-task-allow row at all, so I created one, set the type to boolean, and left it unchecked. It worked great for me.
The best solution to avoid wierdness like this is to create an IPA file. A good step-by-step guide to creating an IPA target in XCode is here:
http://idotcomllc.wordpress.com/2009/05/26/how-to-build-a-ipa-file-from-xcode/
It starts out with an introductory project so search for "Aggregate" to find the point where it starts telling you how to create a new IPA target for build.
I directly upload the app to a server where the windows can also visit. Then compress it in Windows.
I had it, did a clean build and never saw it again.
Incomplete ipa/zip archives (received at the installation end) were the cause for us.
I had this problem using a run script to cp -R the .app file to the Payload folder, for some reason when the script copied the file it modified it somehow, if I used finder and manually copied the .app file into the payload folder and manually zipped the .ipa file it worked fine. I tested it several times using codesign -v to verify the .app file. it always through the error after a build and the run script. but no error when I would copy the file manually.
For me the issue was the .Double files being added to every directory on a shared network drive. We are primarily a Windows environment, and the Mac was saving .Double file on the drive, in every directory.
Literally, to fix the issue referenced above, I simply deleted the .Double files in every directory (of the app being copied to iTunes) and it fixed it.
Hope this helps someone!
I was tasked to test some apps and for some reason was the only one on my team getting this this error. I am working on an XP. All the apps we are testing use the same provisioning file yet some would sync while others would not. Not sure what fixed it but I did go into my *My Music\iTunes\iTunes Media\Mobile Applications* folder, deleted the existing .ipa file for the app I was trying to sync and it seemed to sync fine after. It might not be the answer to your problem but give it a try.
If you work with asstes on a Mac, or have versioned content, I had the same problem with .DS_Store files and hidden .git folders. Once deleted from assets, problem gone. It might be an issue with hidden files.