12

I'm making an iPad app and it runs on the simulator, but fails when i try building it for the device.

the error is below:

enter image description here

These are the things i've tried to rectify this issue:

  • went through every PNG file with Photoshop and saved them again w/o the interlace
  • Deleted all the images in my Resources folder and added them again by dragging/dropping the images again
  • Deleted ALL PNG images (left the JPGs) and it works...when i add one PNG, Xcode throws a hissy fit.
  • Deleted the derivedData in my ~Library/Developer/Xcode
  • quit Xcode and tried again
  • restarted my computer and tried again.

i tried checking about the paths, but i'm not sure. Any ideas would be great please.

Addendum i also want to add that Xcode is throwing errors against its own Default@2x.png and Default.png!

Matthew
  • 2,035
  • 4
  • 25
  • 48
  • Try to clean, usually works for me when getting this problem. Product->Clean. – Christoffer Nov 16 '12 at 21:57
  • i forgot to mention my repeated cleans, still no luck. – Matthew Nov 16 '12 at 21:58
  • but it also says "Library not loaded........ Reason: image not found", are you using all image-names right in the code? More specifically it seems to be the bkg1.png that's the problem. – Christoffer Nov 16 '12 at 22:04
  • 1
    The screenshot above is when my project has all JPGs and one PNG (bkg1.png). Not sure what library is needed for PNGs in Xcode 4.5. Everything runs well on the simulator, but not the device. – Matthew Nov 16 '12 at 22:07
  • This has NOTHING to do with PNG files :D – Daij-Djan May 28 '13 at 14:17

9 Answers9

48

In my case the error is resolved by going to

Build Phases -> Copy Bundle Resources

and removed all the duplicated entries of lunch images DefaultXX.png

Androyal
  • 893
  • 8
  • 7
6

You have to save your PNG files as NOT INTERLACED. For example, by using Photoshop, go to menu File->Save For Web and Devices. Unchecked the box of 'Interlaced' and save the file. Usually interlaced box is unchecked already. Hope that helps

Alphapico
  • 2,893
  • 2
  • 30
  • 29
  • 1
    Thanks! This is exactly my problem! My Default.png and Default@2x.png were really large and the emulator takes them directly without conversion, but when deploying onto the device, there is one extra step which is to convert these heavyweight pngs to a device friendly format, but the conversion tool fails, and thus this confusing error! – Echo Lu May 27 '13 at 21:20
  • This question isn't about pngs – Daij-Djan May 28 '13 at 14:19
5

This has NOTHING to do with png files missing but with a dynamic library you are linking against which isnt available on ios

Daij-Djan
  • 49,552
  • 17
  • 113
  • 135
4

Build Settings -> Search for Compress PNG Files and set to NO . This helped me

Chirila Vasile
  • 359
  • 1
  • 2
  • 11
  • This helped me as well. I had multiple transparent photos with the same name. Thanks. – JDev Oct 04 '14 at 17:24
2

Well, i figured it out. The error log was a bit misleading since it says "Reason: Image not Found" right before the red highlight.

Turns out the "image" isn't the PNG or JPG, but the liberal.dylib as explicitly mentioned above. No idea how my perl library is gone...

Matthew
  • 2,035
  • 4
  • 25
  • 48
0

Check out this, this might be help you.Or delete bkg1.png from your project.

jxdwinter
  • 2,339
  • 6
  • 36
  • 56
0

The error can also occure if you save the file in an unexpected format of what it actually supposed to be. For instance, you save a *.png but with a .jpg encoding. Make sure that the file format is the one you actually want.

perborin
  • 234
  • 2
  • 10
0

Just try deleting the .png extension for the files which are causing you the trouble. Don't know how, but worked for me!

codeburn
  • 1,994
  • 17
  • 20
0

For me this error was occurring when the png was listed in the copy bundle resources phase on the build phases tab. See https://stackoverflow.com/a/5659415/287403

Community
  • 1
  • 1
Bob Spryn
  • 17,742
  • 12
  • 68
  • 91