12

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
sol
  • 329
  • 2
  • 6
  • 13
  • 4
    +1 for nailgun imagery... Have you checked all of your Target, Build settings? Last time I had a similar issue it was caused by whitespace at the beginning of one of the settings fields. – Adam Eberbach Jun 11 '10 at 04:18
  • yes, i've looked over those several times. Interesting that there is not one single google search result for exit code 127. – sol Jun 11 '10 at 04:34
  • tried copying/pasting those commands into terminal? Could also just be something borked and needs a reboot. – Adam Eberbach Jun 11 '10 at 04:40
  • What happened to the files Entitlements.plist and ing_000.png? – fearmint Jun 24 '10 at 20:17
  • 1
    error 127 comes from the shell script itself, and means "file not found". In a terminal, try typing the following: foobar ; echo $? You will see something like this: -bash: foobar: command not found 127 where 127 is the error code for the operation (from $?) – Kalle Jun 29 '10 at 15:25
  • Out of curiosity, how'd this work out for you? – Kalle Aug 16 '10 at 15:37

8 Answers8

2

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?

Community
  • 1
  • 1
Kalle
  • 13,186
  • 7
  • 61
  • 76
  • Thanks for the info. I hope this works. Can you tell me how to add those items to the PATH? – sol Jun 29 '10 at 21:46
  • 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 Jun 30 '10 at 04:57
  • 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 Jun 30 '10 at 13:30
  • 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 Jun 30 '10 at 13:46
1

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
  • 6,388
  • 2
  • 28
  • 34
1

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.

gcamp
  • 14,622
  • 4
  • 54
  • 85
keith
  • 11
  • 1
0

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
  • 20,661
  • 6
  • 33
  • 39
  • /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 Jun 11 '10 at 06:56
  • 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 Jun 12 '10 at 04:25
  • 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 Jun 12 '10 at 05:10
0

Tried reinstalling the SDK?

tc.
  • 33,468
  • 5
  • 78
  • 96
  • 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 Jun 12 '10 at 03:52
  • 1
    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 Jun 14 '10 at 03:59
  • 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. Jun 14 '10 at 14:50
  • Yeah, I actually found the current SDK that I was using and re-installed it. Unfortunately that didn't help at all. – sol Jun 15 '10 at 04:34
0

I have gone over the answers provided and none of them worked for me. The problem persisted.

I looked carefully at the error in xcode and notice that it was looking for the image in the wrong place. In my case I had copied and renamed the directory containing my project. None of the references to my images were updated.

I fixed my problem by right clicking the project file in finder and clicking Show Package Contents. I then opened the *.pbxproj in xcode. I did a find and replace on the file to replace the name of the old folder with the new folder.

After closing and opening xcode this solved my problem.

I hope this helps others...

Dov
  • 161
  • 1
  • 5
0

this error will also show if you deleted a file via finder (not in xcode) then try to archive. So make sure that none of your files are listed in red and if they are remove it from your project.

owen gerig
  • 6,165
  • 6
  • 52
  • 91
0

I've seen this error before. The issue lies in a corrupted .png file. The error is pretty deceiving. Try deleting the affected .png and replace it back in your project from a backup or clean version of that file. That should clear up the build errors.

Bill Burgess
  • 14,054
  • 6
  • 49
  • 86