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

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

#1

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.


3.11 libpng error: CgBI: unhandled critical chunk
#2

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


#3

GOD!!!YOU SAVE MY LIFE!!!


#4

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:


#5

Excellent find, thanks!


#6

Just thank you, saved me hours of going nowhere.

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


#7

what guys? Apple?


#8

Yes, Xcode update


#9

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.


Libpng error: CgBI: unhandled critical chunk
#10

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


#11

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.


#12

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


#13

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


#14

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?


#15

set in xcode build setting this flag to NO

Remove Text Metadata From PNG Files = NO


#16

go to build setting and search

Remove Text Metadata From PNG


#17

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


#18

Thank you so much!! :muscle:


#19

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