Android - JME 3.1 Alpha4 - Caused by: java.io.IOException: progressive jpeg

Hy,

I am trying to migrate to the new version of JME but I have some problems when I start the game in Android.
How I imported the model:

  • Copy-Paste the j3o file from the old sources.
  • Changed the material definition from Lighting to UnshadedNodes

It works ok on my computer but when I deploy it on Android I get the following exception:

E/com.jme3.app.AndroidHarnessFragment(13496): com.jme3.asset.AssetLoadException: An exception has occured while loading asset: Models/teddy/engineer/engineer_txt.jpg (Flipped) (Mipmapped) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:264) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:376) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:393) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.material.plugins.J3MLoader.parseTextureType(J3MLoader.java:259) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.material.plugins.J3MLoader.readValue(J3MLoader.java:283) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.material.plugins.J3MLoader.readValueParam(J3MLoader.java:404) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.material.plugins.J3MLoader.readExtendingMaterialParams(J3MLoader.java:420) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.material.plugins.J3MLoader.loadFromRoot(J3MLoader.java:660) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.material.plugins.J3MLoader.load(J3MLoader.java:689) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:262) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:376) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadMaterial(DesktopAssetManager.java:397) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.scene.Geometry.read(Geometry.java:622) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.scene.Node.read(Node.java:748) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.scene.Node.read(Node.java:748) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.scene.Node.read(Node.java:748) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:342) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:242) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:125) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:109) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:262) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:376) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:419) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:423) E/com.jme3.app.AndroidHarnessFragment(13496): at mygame.Main.simpleInitApp(Main.java:31) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:227) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.app.AndroidHarnessFragment.initialize(AndroidHarnessFragment.java:556) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:328) E/com.jme3.app.AndroidHarnessFragment(13496): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1583) E/com.jme3.app.AndroidHarnessFragment(13496): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1286) E/com.jme3.app.AndroidHarnessFragment(13496): Caused by: java.io.IOException: progressive jpeg E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.texture.plugins.AndroidNativeImageLoader.load(Native Method) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.texture.plugins.AndroidNativeImageLoader.load(AndroidNativeImageLoader.java:33) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.texture.plugins.AndroidNativeImageLoader.load(AndroidNativeImageLoader.java:18) E/com.jme3.app.AndroidHarnessFragment(13496): at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:262) E/com.jme3.app.AndroidHarnessFragment(13496): ... 41 more

This didn’t happened in JME 3.0.
Any ideas?

Solved it. I have exported the image from Gimp and I have unchecked the progressive option and now it works.

mhhh why?
UnshadedNodes is Unshaded, but with shader nodes… if you want lighting, keep using lighting.

In JME 3.1 we use a native image loader instead of relying on the Android OS to load the image like we did in jME 3.0. There are a lot of benefits to doing this, but the downside is it doesn’t handle jpegs with progressive. Just as you’ve done, you need to disable progressive on jME 3.1 projects (Android only).

Switching materials should have nothing to do with this.

Thanks for your replies.

I know the material doesn’t have to do with the jpeg error.
I changed from lighting because the new version of jmonkey crashes when I try to open a model with lighting material on it. Since I don’t have enough time right now I didn’t signal a bug.

When I will have more time I will study the problem in more depth and maybe post the problem on the forum.

If you want I can give you a model to play with it until you make the new sdk crash :smile: