jmonkeyengine: AndroidNativeImageLoader failing to load

I just tried to start a simple android test application, but the result I got was:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.github.MeFisto94.android.jme3.test-1/base.apk"],nativeLibraryDirectories=[/data/app/com.github.MeFisto94.android.jme3.test-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libdecodejme.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:984)
        at java.lang.System.loadLibrary(System.java:1530)
        at com.jme3.texture.plugins.AndroidNativeImageLoader.<clinit>(AndroidNativeImageLoader.java:23)
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:400)
        at java.lang.Class.forName(Class.java:326)
        at com.jme3.asset.AssetConfig.acquireClass(AssetConfig.java:62)
        at com.jme3.asset.AssetConfig.loadText(AssetConfig.java:86)
        at com.jme3.asset.DesktopAssetManager.loadConfigFile(DesktopAssetManager.java:96)
        at com.jme3.asset.DesktopAssetManager.<init>(DesktopAssetManager.java:89)
        at com.jme3.system.JmeSystemDelegate.newAssetManager(JmeSystemDelegate.java:125)
        at com.jme3.system.JmeSystem.newAssetManager(JmeSystem.java:139)
        at com.jme3.app.LegacyApplication.initAssetManager(LegacyApplication.java:216)
        at com.jme3.app.LegacyApplication.initialize(LegacyApplication.java:593)
        at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:197)
        at com.jme3.app.AndroidHarness.initialize(AndroidHarness.java:477)

TLDR: Something is wrong with the natives again, I guess. @riccardobl Do we need to do something more than just adding jme3-android as dependency? I’ve only found https://mvnrepository.com/artifact/org.jmonkeyengine/jme3-bullet-native-android but it shouldn’t include the Image Loader.

Edit: Either this https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-android-native should be a separate artifact or part of jme3-android as dependency (I strongly guess and suggest the latter), so I guess that’s the problem already.

Certainly missing that in https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-android/build.gradle though.

Edit2:

Sorry for the misinformation

Actually there is a jme3-android-native artifact, but I don’t think it’s what we want, is it? Why would someone omit it? If someone wants to omit it, the AndroidNativeImageLoader needs to be shifted to that artifact, so that it’s not visible for the DesktopAssetManager

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 19 (19 by maintainers)

Most upvoted comments

Additional Android examples would be welcome. Probably they should go in the jme3-android-examples folder/directory.

To install jme3-android-native to MavenLocal: ./gradlew :jme3-android-native:install

Trying to summarize…

  • The original bug report was a “pilot error”: not listing jme3-android-native as a runtime dependency of the application.
  • There are reasons to keep jme3-android and jme3-android-native as separate libraries.

The actual issues here seem to be documentation issues:

  • Document how to build JME applications for Android: what dependencies are needed.
  • Document how to deploy the jme3-android-native library to MavenLocal.

Why jme3-android-native is separate? Because we usually always separated native and java code afaicr. That way you could still use and build everything java without having native compilers, Android NDK and whatnot installed.

Or was that not the question? 😃

Mhm, I’d vote for keeping it separate as well for those reasons. The native code might change, get deprecated, become platform dependent or something like that. This way it’s easy to root out the cancer if it becomes malignant 😉

But my vote shouldn’t count here anymore as I didn’t follow the changes at all for at least a year, if not two. You know best what is what and what works these days.

But as always if you need any help when you end up in a dark corner of the codebase with only some //normen: TODO: WTF lines looking at you or something - I’m here 😃