Xcode 4.3.2 Default Launch Image Corrupted Bottom Pixel

Go To StackoverFlow.com

4

When I launch my app on iOS 5.1, on a device (only tested on retina display so far), the Default@2x.png image is displayed with a single green line below the bottom of the image. I've confirmed the image is 640x960, and does not contain this green line.

I'm guessing this must be due to an issue with the PNG optimization tool Xcode is running prior to adding the resources to the bundle, especially since I don't see this when I run using the simulator.

Is there a way to repair or update this PNG optimization utility? (I'm running the latest Xcode 4.3.2 for Lion, from the Mac App Store).

2012-04-04 21:26
by Prometheus
I've confirmed the issue is due to png compression. You can turn off "Compress PNG Files" in your target build settings and this issue goes away. This question describes how to determine the location xcode is using for pngcrush: http://stackoverflow.com/questions/9338019/where-is-pngcrush-for-xcode-4-3. Now I'm looking for a way to install a working version of pngcrush so I can still get optimized files without this corruption - Prometheus 2012-04-04 21:42


4

There is a bug in pngcrush 1.6.4 which is installed in the app bundle of Xcode 4.3.2. I was able to fix this by following these instructions (thanks to http://www.mactricksandtips.com/2012/02/installing-and-using-pngcrush-on-your-mac.html):

  1. Download the latest release version of pngcrush here: http://sourceforge.net/projects/pmt/files/pngcrush/
  2. Unzip the file using your favorite compression utility (or, in Terminal (or your favorite command line tool), navigate to the directory where you saved this download, and run this command (you may need to change the version number according to your download)

    tar -xvzf pngcrush-1.7.15.tar.xz

  3. Navigate to the unzipped directory in your command line tool.
  4. Run the command "make"
  5. Run the command "sudo cp pngcrush /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/pngcrush" to copy this latest version on top of the old version.
2012-04-04 22:07
by Prometheus
You can also get pngcrush binaries (1.7.22, liblibpng.dylib and pngcrush) inside ImageOptim application bundle - Damien Debin 2012-04-19 13:09
Wow, this worked for me! Thanks, Apple.... :- - Ron 2012-12-13 06:40
Confirmed that this issue is STILL present as of Xcode Version 6.1.1 (6A2008a). Be sure to copy both liblibpng.dylib and pngcrush from ImageOptim as Damin Debin suggested, and also clean your build folder by pressing command-option-shift-k and removing your app from your device then re-running it. Otherwise Xcode may use a cached copy of the corrupted image - Zack Morris 2015-01-14 23:08


0

For those like me, hitting this issue with XCode 4.5.2, this bug seems to manifest itself when the project.pbxproj has a conflict with PNG image file records as described in this support forum thread: https://devforums.apple.com/message/731402

Unlike the answer in that thread (ie., hand editing the .pbxproj file, not my favorite thing to do...) I found that deleting the references to the offending images and adding them again to the project file corrected the issue.

2012-11-25 21:15
by MoFlo
Ads