[Resolved] Building the app screws up the pngs

Ok folks … here’s a fun one.

Yesterday (Mar 21) I was working on our game for work. Going well. Running Snow Leopard, XCode 4.2 and CoronaSDK 2012.767 like a boss.

Now, I built my app and put it on the iPad that morning no problem. Made adjustments per the bosses request (nothing outstanding) and then went to lunch. Came back, built the app again and …

…my png files, every single one, were blank. There was still a placer for them in the .app content folder, but they all were empty.

Naturally I calmly freaked out.

I decided to upgrade my Corona, hoping it would work - nada.

I deleted Corona completely and reinstalled - negative.

I tried other projects, including sample projects - bubkiss.

I went extreme and upgraded the OS to Lion - Negatory.

I repaired system permissions - No.

I shook my fist at my monitor - Fail.

I spat curses while waving my arms in a violent fashion - Ridiculous.

I lay my hands on my Mac and pray over it - No go.

So here I am, my bosses breathing down my neck to finish this game. A client coming in for another app. Things piling up and I have no idea what to do now. IRC didn’t really give me any better ideas past repairing permissions, only two folks were available to answer and I appreciate their advice greatly.

I’m kind of in major trouble here. We are scheduled to submit our game to the store tomorrow with a whole docket of games in the queue waiting to be built. If this project gets screwed, the whole queue gets taken to the parking lot, burned and the ashes kicked into the wind by our investor.

Anyone have ANY ideas that I’ve not already tried? I’m getting pretty desperate here. [import]uid: 97023 topic_id: 23744 reply_id: 323744[/import]

Does the same thing happen with JPG’s?

If its an permission issue, i would think every file would be a problem, not only PNG’s

I guess Corona doesn’t show any weird messages when you compile?
[import]uid: 50459 topic_id: 23744 reply_id: 95466[/import]

No, no error messages. And JPGs are perfect. [import]uid: 97023 topic_id: 23744 reply_id: 95469[/import]

Hang on, so your png’s on your computer got corrupted after building or are you saying the png files in your .app’s content folder are all white?

If so that’s completely normal, they should still display fine on device. I’m pretty sure it’s an apple thing where they do it to protect your assets from being stolen [import]uid: 84637 topic_id: 23744 reply_id: 95470[/import]

Ok sorry.

In my project folder the PNGs are good, not corrupt. In simulator they show up perfectly fine.

When I build the app, in the .app content all the PNG files are transparent, not white.
When I put it on the iPad/device they’re 100% transparent, empty images.

The JPG I can see and glare at for mocking me. [import]uid: 97023 topic_id: 23744 reply_id: 95473[/import]

@taddmencer are you using any compression/optimization on your PNGs before building the app? [import]uid: 120 topic_id: 23744 reply_id: 95476[/import]

I did a while ago and it built fine at the time until yesterday. [import]uid: 97023 topic_id: 23744 reply_id: 95478[/import]

When I was aggressively optimizing using ImageAlpha and ImageOptim I had this issue where the images simply didn’t appear… but they weren’t showing up in the Simulator as well as the build. Just a thought. [import]uid: 120 topic_id: 23744 reply_id: 95487[/import]

Same thing happened to me too – i.e., optimizing PNG files made the PNG images to appear blank on device. I immediately reverted all PNG files back to how they were before I used the optimization tool.

Naomi [import]uid: 67217 topic_id: 23744 reply_id: 95509[/import]

The thing is, they’ve been optimized for literally weeks. I didn’t touch those files yesterday prior to this problem. [import]uid: 97023 topic_id: 23744 reply_id: 95511[/import]

“I tried other projects, including sample projects - bubkiss.”

Does that mean the sample projects aren’t loading images either, or that they work fine?

Did you try building on a different machine all together?

Is the app producing any errors or warnings in the console? [import]uid: 120 topic_id: 23744 reply_id: 95521[/import]

Corona runs the image optimizer tools on your images automatically when building. So doing this yourself then corona doing it probably has caused the issue.

Rule of the thumb, let corona do it [import]uid: 84637 topic_id: 23744 reply_id: 95525[/import]

That is what it means, yes. I tried 3 different projects and nothing.

And I didn’t try to build on other computers, mine is the only one with the certification and all that Mac-y stuff. [import]uid: 97023 topic_id: 23744 reply_id: 95526[/import]

Ok. So. Why then did this not cause any problems yesterday until lunch. Did Corona not like my soup I ate? It smelled?

I had optimized my images a while ago. Not recently. Only recently was there any problems.

Can I disable corona’s image optimizer? I know I in build.settings to ignore it in Xcode (COMPRESS_PNG_FILES = false,) but that didn’t solve the issue in the end. [import]uid: 97023 topic_id: 23744 reply_id: 95527[/import]

Just to make sure I understood, you’ve updated your Xcode to 4.3.1 after you upgraded from Snow Leopard to Lion, right? I don’t know how it relates to PNG issue, but just in case…

Naomi [import]uid: 67217 topic_id: 23744 reply_id: 95538[/import]

Naomi, yes exactly. Trying to throw stones at any possible target to see if I hit anything., So far, nothing has worked to fix my problem.

Trying to go through a re-save all our assets and over-write the current PNGs with new ones to see if that works. Would take me a while to do this if it works, but at this point I’d take it!

EDIT: Ok, that did NOT work. So letting Corona do it, as Danny suggested, was not the answer. [import]uid: 97023 topic_id: 23744 reply_id: 95541[/import]

So just for shits and giggles I ran an image through every algorithm that ImageAlpha (http://pngmini.com) has to offer and it turns out that all of them load in the Simulator and on the iPad (2). So whatever problem I was experiencing a few weeks ago must have been due to some other factor.

Source: http://dl.dropbox.com/u/8450479/ImageOptimization.zip [import]uid: 120 topic_id: 23744 reply_id: 95545[/import]

Did you say you can see the PNG files on simulator but not when the app is installed on device?

Did you also delete the not-working-app from the device before you installed the fresh new app that you just built with the PNGs that weren’t optimized?

Not sure if it helps, but why not cover all grounds…

Naomi [import]uid: 67217 topic_id: 23744 reply_id: 95546[/import]

Oh … man … I am such an idiot.

Here is the problem:

In my file it says to read the last line of the saved file. Then show these images. Which are the first PNGs you see in the app.

So, on the ipad the saved file isn’t created yet. So it stops running and didn’t throw errors. I automatically looked at my .app and it showed all pngs as corrupt making me think it was the PNGs.

SO, all this was looking for a bug that didn’t exist.

I am completely embarrassed by my stupidity in this.

Thank you everyone who tried to help me hunt this non-existant bug. It was apparently a problem between the chair and the keyboard. [import]uid: 97023 topic_id: 23744 reply_id: 95550[/import]

Well at least you solved it :slight_smile:

[import]uid: 50459 topic_id: 23744 reply_id: 95554[/import]