[Solved] libpng error: CgBI: unhandled critical chunk + Xcode 7.3

In case anyone else runs into this: My Cocos2dx 3.5 project started crashing when I upgraded to xCode 7.3 today. The fix I found was to go into build settings and set

Remove Text Metadata From PNG Files = NO.

Looks like a new parameter that defaults to YES which causes libpng to fail.

4 Likes

Thanks. This was something I was starting to look into :slight_smile: Saved some time.

GOD!!!YOU SAVE MY LIFE!!!

Thanks @jaunt!! :smiley:

I’ve just spent over an hour trying to figure out why my game is suddenly crashing. I should have looked here first! :stuck_out_tongue:

Excellent find, thanks!

Just thank you, saved me hours of going nowhere.

How can these guys update a critical tool with such features…

what guys? Apple?

Yes, Xcode update

Also worth noting, that if you do not have a PNG file in the root of the folder, you won’t see PNG options. This caused me a lot of trouble as one project I could turn this XCode bug off, but in another project I had to add a file called “thanks_xcode.png” to Resources directly.

Hi guys,I use xocde 7.3, cocos2dx 3.5. sprite lost texture sometimes. maybe cause by this bug?
which version is your libpng ?

I have Xcode 8.0 and can’t find the “Remove Text Metadata From PNG Files” option anywhere.

Instead, I have to change the ‘Type’ of the png image to ‘Data’ under right-click->Show File Inspector.

This option is still there in Xcode 8 (build settings, section “Compress PNG Files - Packaging”)

All I see is the Compress PNG option… how can I unlock the “Remove Text Metadata From PNG Files” option?

Humm that’s weird, i’ve the other option right under this one.
My project uses the old “Xcode 3.2 - compatible” project format (you can see it on the right column). Maybe yours is different and maybe this option is only available with old project format?

set in xcode build setting this flag to NO

Remove Text Metadata From PNG Files = NO

go to build setting and search

Remove Text Metadata From PNG

Thk so much, save a lot of time :slight_smile:

Thank you so much!! :muscle:

Thanks god! It’s working, remove METADATA works!