views:

137

answers:

2

I have an issue where an image resource (Default.png) is included in a build for the simulator but is not being included when built for device. I have verified this by looking at the *.app package contents? I have also verified that the resource is selected for the active target. Any thoughts on what else I can look at to debug this?

Thanks.

+1  A: 

Try removing it from the project and re-adding it. I don't know why or how, but it's possible that the reference got lost somewhere. Re-adding it should rule out that possibility.

If it still isn't included after re-adding it to the project, then start to work with the assumption that there is something wrong with the file itself, perhaps its encoding, which may cause it to work on the simulator rather than the device.

Jasarien
Thank you. I have tried re-adding it but still the same result. Considered that the file was bad but it's not even being included in the build leading me to believe it's a build problem and not a file problem. Still, I've asked our artist to recreate the file. We'll see what happens.
Greypoint
There was apparently something wrong with the file though it looked like a normal PNG to the OS. Preview worked etc. Thanks for the assistance.
Greypoint
I've seen this happen sometimes after saving PNGs from Photoshop. I'm not exactly sure what causes it, but the resulting images work fine in the simulator, but then never appear on the device. I believe it has something to do with the pngcrush utility that optimises PNGs for use on the iPhone. If the PNG is somehow not encoded properly before it enters pngcrush, then the result will be corrupt... Glad it's working now though.
Jasarien
+1  A: 

You should clean your target (Build->Clean All Targets) and try again. It seems pretty unlikely that the file encoding is wrong. Though I guess it's possible.

Martin
Had tried cleaning all but it didn't make a difference.
Greypoint