Problems when bundling for iOS with a framework


I am integrating the Mixpanel framework for iOS and Defold has problems with some of it’s files.

  • Image files somehow have invalid header (getting I/O error), but open fine in editors.
  • Some files have “~” character in it’s name, but Defold says it’s an illegal character (it’s not).

PNGs are inside the framework.



We added restriction for ~as a extra safety measure to not be able to include things from the home folder. And, tbh, I’ve never seen that character used in filenames. Why they couldn’t just use - is beyond me.

We can probably change that at some point.
Workaround is ofc to rename the files for now.



But renaming will probably break the extension? Won’t find it’s storyboard.



Ah, ofc. Then I don’t know of any workaround right now.



What about failing to build due to PNG files?
I think the builder shouldn’t even care about PNG files inside frameworks.



We just add the frameworks to the command line.
What is the error you’re getting?
And why is there a png inside it?



I am getting

	I/O error reading PNG header!

when trying to build with this framework. I had to resave each PNG file for Defold to stop complaining, they open in editors just fine. It’s not the first time I stumble across such problem.
Some frameworks include UI elements, hence storyboards and images.



It seems like bob doesn’t like the png files. I get:

javax.imageio.IIOException: I/O error reading PNG header!
	at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readHeader(
	at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readMetadata(
	at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readImage(
	at java.desktop/
	at java.desktop/
	at java.desktop/
	at com.dynamo.bob.pipeline.TextureGenerator.generate(
	at com.dynamo.bob.Project.runTasks(
	at com.dynamo.bob.Project.doBuild(
	at com.dynamo.bob.Bob.main(
Caused by: javax.imageio.IIOException: Bad length for IHDR chunk!
	at java.desktop/com.sun.imageio.plugins.png.PNGImageReader.readHeader(

If I resave the image within the .framework bob no longer complains about the images but instead we stop at the ~ character in the filenames. We’ll change this on the build server to only prevent it if the path starts with a tilde character.

1 Like