Weird error to do with images in xcode, uncategorised, pngcrush and copy png file error?

12.7k Views Asked by At
(null): While reading /Users/lewiselliott/Desktop/Final Version/2bm/2bm/static.png pngcrush caught libpng error:
(null): Could not find file: /Users/lewiselliott/Desktop/Final Version/2bm/build/Debug-iphoneos/2bm.app/static.png
Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/iPhoneOS Build System Support.xcplugin/Contents/Resources/copypng emitted errors but did not return a nonzero exit code to indicate failure

What does this mean and why has it only just started happening, how do I fix it?

6

There are 6 best solutions below

0
On BEST ANSWER

I'm guessing that this happened when testing the application on a device. It is because of your image static.png. It isn't a png file. Remove that file and try again. Also, I'm guessing that the application doesn't crush and the above mentioned image is not showing anywhere where it should. Try opening the file in photoshop and save it as a png.

0
On

I had same problem. I checked all my targets and found that [email protected] was added only once([email protected] was the file which was causing problem for me). I simply unchecked 'compress PNG files' option in Project -> Target -> Build Settings -> Packaging -> Compress PNG Files and It did worked for me.

0
On

I had a file with .png extension that when I only changed the extension to .jpg - it didn't work. I couldn't really tell what image format it was supposed to be...

So I searched for an online image converter that would maybe "swallow" that corrupted piece of art and make a decent formatted image out of it and first search in Google gave me this.

It did the job well. After it was converted to JPEG I was able to open it with an online image editor and save it as PNG. That refreshed PNG worked like a charm.

1
On

I had this problem too. Turned out I had two sets of png files with same name in two different groups. I deleted it all and loaded one set. Then it worked fine. My problem was with the Default.png files used for splash screen.

2
On

I had this problem. Two targets were added for same image. Goto project target ->Build Phases -> Copy Bundle Resources and search for your image file name. Most likely there are two entries. Remove one.

0
On

Had a similar issue. My problem was that I saved it as a jpg, but named it a png file. I don't think xcode liked that very much.