Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone build error that makes me want to buy a nail gun

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
like image 918
sol Avatar asked Jun 11 '10 03:06

sol


3 Answers

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. where is $PATH set in xcode?

like image 105
Kalle Avatar answered Sep 19 '22 15:09

Kalle


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

like image 43
Dad Avatar answered Sep 22 '22 15:09

Dad


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 Xcode, OS X or Apple.

like image 25
keith Avatar answered Sep 21 '22 15:09

keith