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

StackOverflow https://stackoverflow.com/questions/12180675

  •  29-06-2021
  •  | 
  •  

Domanda

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

È stato utile?

Soluzione

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.

Altri suggerimenti

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.

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.

I had same problem. I checked all my targets and found that Default-568@2x.png was added only once(Default-568@2x.png 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.

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.

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top