I’m developing on android studio and i get this error whenever i am testing a textured gltf file. It works fine with untextured version of my model. Here’s the stacktrace:
com.jme3.asset.AssetLoadException: An error occurred loading Models/textured-cube.glb
at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:150)
at com.jme3.scene.plugins.gltf.GlbLoader.load(GlbLoader.java:47)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:260)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:374)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:417)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:421)
at com.bluetowel.core.src.Game.simpleInitApp(Game.java:76)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:239)
at com.jme3.app.AndroidHarness.initialize(AndroidHarness.java:477)
at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:346)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
Caused by: java.lang.IllegalStateException: Stream already opened
at com.jme3.asset.StreamAssetInfo.openStream(StreamAssetInfo.java:54)
at com.jme3.texture.plugins.AndroidNativeImageLoader.load(AndroidNativeImageLoader.java:33)
at com.jme3.texture.plugins.AndroidNativeImageLoader.load(AndroidNativeImageLoader.java:18)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:260)
at com.jme3.asset.DesktopAssetManager.loadAssetFromStream(DesktopAssetManager.java:342)
at com.jme3.scene.plugins.gltf.GltfLoader.readImage(GltfLoader.java:724)
at com.jme3.scene.plugins.gltf.GltfLoader.readTexture(GltfLoader.java:695)
at com.jme3.scene.plugins.gltf.GltfLoader.readTexture(GltfLoader.java:679)
at com.jme3.scene.plugins.gltf.GltfLoader.readMaterial(GltfLoader.java:609)
Pawan’s boilerplate project doesn’t have an assets folder. So it’s likely the project doesn’t support locating assets there.
JMonkeyEngine’s default asset locator looks for assets on the classpath. When you develop in the JMonkeyEngine SDK, the SDK automatically copies assets from your project’s asset folder into the class jar, so they are accessible to the application. Android Studio doesn’t do this—at least, not by default.
I would’ve expected the opposite or something, but I guess it’s because loading textures differs there.
Probably textures in gltf+bin get loaded manually.
A breakpoint on this method would tell you why, but you’d need to setup an android project first etc pp.
No, it’s not 3.3.0-stable. You need to locally build jme3-android package with gradle from the source code on master branch. After build you should get jme3-android-3.4.0-SNAPSHOT.jar.
But wait, in case you want, I can upload it for you so you won’t need to build it yourself.
And just to be clear, 3.3.0-stable is fixed in stone. it will never again change for all of future-time. 10 years from now, 3.3.0-stable will have the exact same bytes in it that it does today.
Any new released code would have a new version when it’s eventually released.
So any new fixes that are posted will not be in 3.3.0-stable… but some future 3.3.1 or 3.4.0 or whatever. (or a local 3.4.0-SNAPSHOT if you build from source).