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

6

14
(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?

Capsize answered 29/8, 2012 at 14:47 Comment(1)
You may also try this answer which involves saving your PNG files as NOT INTERLACED.Glasgo
F
23

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.

Frore answered 29/8, 2012 at 15:9 Comment(0)
H
79

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.

Hedvah answered 24/1, 2013 at 23:38 Comment(2)
This fixed my problem, too. I just want also mention to others to BEWARE THE TEMP FIX: if you get this error and simply check your device in the Organizer and then delete the app there (so you can reload it by running in Xcode), it may fix your problem but (according to Murphy's Law) only until you need to release it!!Preiser
This also happens with two different files with the same name but in different directory. (For me, it's for two different targets)Synovia
F
23

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.

Frore answered 29/8, 2012 at 15:9 Comment(0)
Y
12

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.

Yucca answered 22/1, 2013 at 13:14 Comment(1)
Had this problem too. Someone had added the Default* files to an images folder and those were the ones being used. Our graphics designer gave us final versions and I dragged them to the little "wells" in Xcode for each of the "splash" screen entries and Xcode put the new ones at the root of the project so there were two Default.png in the project. Thanks!Linseed
H
5

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.

Hemipterous answered 1/9, 2013 at 8:58 Comment(0)
B
1

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.

Barkley answered 29/3, 2013 at 5:35 Comment(0)
A
0

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.

Appose answered 8/6, 2014 at 5:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.