views:

338

answers:

6

I'm just trying to build a simple update (which I have done before) for an iphone app, but now for some reason I'm getting this error. Can anyone tell me what it means?

Command/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127
sh: plutil: command not found

Here are the Build Results:

CopyPNGFile /Users/me/path/build/Dist-iphoneos/MyApp.app/img_000.png images/img_000.png
    cd /Users/me/
    setenv COPY_COMMAND /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
    "/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng" -compress "" /Users/path/images/img_000.png /Users/me/path/build/Dist-iphoneos/MyApp.app/img_000.png
sh: dirname: command not found

CopyPlistFile /Users/me/path/build/Dist-iphoneos/MyApp.app/Entitlements.plist Entitlements.plist
    cd /Users/me/
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"
    /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist --convert binary1 Entitlements.plist --outdir /Users/me/path/build/Dist-iphoneos/MyApp.app
sh: plutil: command not found
A: 

plutil usually resides in /usr/bin. Make sure it's there. If it's not, you may have installed your Developer Tools without unchecking (or with unchecking) the System Tools checkbox, which puts the base Mac OS X programmer tools into /usr.

cdespinosa
/usr/bin relative to what directory? Doing a search for folders called "usr" shows about 30 folders. If this is the problem how do I fix it?
sol
If it starts with a slash, it's an absolute path, not relative. There is a /usr/bin directory on your OS boot drive, and that's where tools like plutil are. (It doesn't show up in the Finder. You have to use Go to Folder to get there, or look using the Terminal command line.) If they're not there, reinstall the Xcode Tools and make sure to check the System Tools checkbox.
cdespinosa
ok, I verified that plutil exists. I also reinstalled the whole Xcode/iphone package, with System tools checked. Now I get the same error even why I just try to build with Simulator/Debug. Awesome.
sol
A: 

Tried reinstalling the SDK?

tc.
Was going to try that, but when I downloaded the SDK I found that Snow Leopard is now required. Went to download Snow Leopard, found that it's a "box-only" purchase. Every time I think I can't loathe Apple any more, they find another way... Why can't they offer downloads of previous versions?
sol
Maybe because Snow Leopard is *not* a previous version, but actually the *current* version as of this writing. On the other hand, I agree that all their operating systems should be available as a (paid) download.
Gregory Higley
I think sol is looking for older versions of the SDK. Try clicking "Mac Dev Center", "Developer Downloads", "Developer Tools", and download Xcode 3.1.4. It doesn't have the iPhone SDK but it shouldn't overwrite it either (keep a backup of /Developer/Platforms though, just in case). I just download everything immediately when released and archive it for moments like this.
tc.
Yeah, I actually found the current SDK that I was using and re-installed it. Unfortunately that didn't help at all.
sol
+1  A: 

Is it possible that your path environment variable is not set somehow?

You have:

setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/" /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist --convert binary1 Entitlements.plist --outdir /Users/me/path/build/Dist-iphoneos/MyApp.app

While I show:

setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/opt/local/bin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin" builtin-infoPlistUtility test34-Info.plist -genpkginfo /Users/gnd/Desktop/test34/build/Debug-iphonesimulator/test34.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/gnd/Desktop/test34/build/Debug-iphonesimulator/test34.app/Info.plist

I don't see /usr/bin in your path.

(in terminal:
echo ${PATH}

though most OS X GUI applications get their path from ~/.MacOSX/environment.plist not 100% sure about Xcode though.


Additional Info:

from the 'man bash' page:

When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.

So if you have it in .bash_login but .bash_profile exists, then your change will not be seen.

Also note the comment about the GUI apps PATH definition alternate file above.

You may need to log out and then back in to get the change to "take".

Dad
How do I add /usr/bin to the path?
sol
+2  A: 

Your PATH variable is screwed up for some reason. You want to look into how exactly that happened. This is yours (colon-separated for emphasis):

setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
    :/Developer/usr/bin
    :/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/"

This is what a working PATH looks like:

setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
    :/Developer/usr/bin
    :/usr/bin
    :/bin
    :/usr/sbin
    :/sbin"

(line separation is to clarify how PATH variables are separating paths)

Notice how mine has /usr/bin:/bin:/usr/sbin:/sbin and yours does not? This is the problem right there. The shell script only finds executables in its path, and while the files are in /usr/bin/, it doesn't find them.

For an SO discussion on Xcode PATH's, see e.g. http://stackoverflow.com/questions/932424/where-is-path-set-in-xcode

Kalle
Thanks for the info. I hope this works. Can you tell me how to add those items to the PATH?
sol
I was able to change the path, but it still doesn't work. Please see my "answer" below - wouldn't fit in the comment box
sol
Ah-hum, weird. It seems Xcode doesn't actually use the PATH that you've set, still. If you look at your line, it goes setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/" still (from your answer below).
Kalle
http://developer.apple.com/mac/library/qa/qa2001/qa1255.html seems to be the ultimate answer to your problem. For the record, it looks like the root of your woes stem in JavaVM as it is in your path and not in mine. Installing it, it probably butchered the default path for you somehow.
Kalle
A: 

I have changed the path -- echo $PATH gives this result: /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin

However, Xcode still fails:

CopyPlistFile build/Debug-iphonesimulator/MyApp.app/Entitlements.plist Entitlements.plist cd /Users/me/Desktop/iPhone_local/rha1_update3 setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/System/Library/Frameworks/JavaVM.frameworK/Versions/1.6/Home/" /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist --convert binary1 Entitlements.plist --outdir /Users/me/Desktop/iPhone_local/rha1_update3/build/Debug-iphonesimulator/MyApp.app

sh: plutil: command not found Command /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copyplist failed with exit code 127

So I can't get Xcode to read the environment path. Anyone know if nail guns are on sale?

sol
A: 

I had same problem.... the problem is that plutil is not in any of the directories in PATH.

My solution was to make a copy from /usr/bin to /user/local/bin which is in the PATH.

No idea if the problem is xocde, osx or Apple.

keith