[SOLVED] java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader couldn't find "libdecodejme.so"

I know that android audio was fixed beginning from v3.4.0-alpha4
So, when trying it , i get this exception :

2021-03-31 16:53:18.198 30426-30466/com.scrappers.dbcodecamp E/AndroidRuntime: FATAL EXCEPTION: GLThread 6188
    Process: com.scrappers.dbcodecamp, PID: 30426
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.scrappers.dbcodecamp-EmOcQPIhj433eC520rkAjQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.scrappers.dbcodecamp-EmOcQPIhj433eC520rkAjQ==/lib/arm64, /data/app/com.scrappers.dbcodecamp-EmOcQPIhj433eC520rkAjQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libdecodejme.so"
        at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
        at java.lang.System.loadLibrary(System.java:1669)
        at com.jme3.texture.plugins.AndroidNativeImageLoader.<clinit>(AndroidNativeImageLoader.java:23)
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at java.lang.Class.forName(Class.java:378)
        at com.jme3.asset.AssetConfig.acquireClass(AssetConfig.java:62)
        at com.jme3.asset.AssetConfig.loadText(AssetConfig.java:87)
        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:220)
        at com.jme3.app.LegacyApplication.initialize(LegacyApplication.java:618)
        at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:196)
        at com.scrappers.superiorExtendedEngine.jmeSurfaceView.JmeSurfaceView.lambda$initialize$0$JmeSurfaceView(JmeSurfaceView.java:135)
        at com.scrappers.superiorExtendedEngine.jmeSurfaceView.-$$Lambda$JmeSurfaceView$Nji4br6xxw318E8h0EujLDeMC_U.run(Unknown Source:2)
        at com.jme3.app.LegacyApplication$RunnableWrapper.call(LegacyApplication.java:822)
        at com.jme3.app.AppTask.invoke(AppTask.java:147)
        at com.jme3.app.LegacyApplication.runQueuedTasks(LegacyApplication.java:733)
        at com.jme3.app.LegacyApplication.update(LegacyApplication.java:748)
        at com.jme3.app.SimpleApplication.update(SimpleApplication.java:245)
        at com.scrappers.superiorExtendedEngine.jmeSurfaceView.JmeSurfaceView.update(JmeSurfaceView.java:155)
        at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:350)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
2021-03-31 16:53:18.198 30426-30466/com.scrappers.dbcodecamp I/System.out: Exception thrown in Thread[GLThread 6188,5,main]

…Notice : this exception isn’t related by any means to the audio , it means that the android native object file that wraps the native module package isn’t found …it’s the same as :

1)[SOLVED] SNAPSHOT leads to some troubles on Android

2)AndroidNativeImageLoader failing to load · Issue #1294 · jMonkeyEngine/jmonkeyengine · GitHub

1 Like

I suggest to merge both the native & the java module , but we will need to test this before doing the merge.

EDIT :

This happens when i add android-native3.4.0-alpha4 in gradle :

    implementation "org.jmonkeyengine:jme3-android-native:3.4.0-alpha4"

how about

runtimeOnly 'org.jmonkeyengine:jme3-android-native:3.4.0-alpha4'

?

1 Like

I can reproduce this as well with 3.4.0-alpha4.

04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): SEVERE Exception thrown in Thread[GLThread 205,5,main]
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mycompany.mygame-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mycompany.mygame-1/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libdecodejme.so"
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at java.lang.Runtime.loadLibrary0(Runtime.java:984)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at java.lang.System.loadLibrary(System.java:1530)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.texture.plugins.AndroidNativeImageLoader.<clinit>(AndroidNativeImageLoader.java:23)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at java.lang.Class.classForName(Native Method)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at java.lang.Class.forName(Class.java:400)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at java.lang.Class.forName(Class.java:326)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.asset.AssetConfig.acquireClass(AssetConfig.java:62)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.asset.AssetConfig.loadText(AssetConfig.java:87)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.asset.DesktopAssetManager.loadConfigFile(DesktopAssetManager.java:96)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.asset.DesktopAssetManager.<init>(DesktopAssetManager.java:89)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.system.JmeSystemDelegate.newAssetManager(JmeSystemDelegate.java:125)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.system.JmeSystem.newAssetManager(JmeSystem.java:139)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.app.LegacyApplication.initAssetManager(LegacyApplication.java:220)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.app.LegacyApplication.initialize(LegacyApplication.java:618)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:196)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.app.AndroidHarnessFragment.initialize(AndroidHarnessFragment.java:555)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:342)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1548)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1259)
04-01 03:20:14.053 E/com.jme3.app.AndroidHarnessFragment(3035): 
04-01 03:20:14.195 I/ActivityManager(623): Displayed com.mycompany.mygame/.MainActivity: +633ms

It works fine on 3.4.0-alpha3.

These are the changes from alpha3 to alpha4:

2 Likes

No difference.

2 Likes

Hmm, the jme3-android-native.jar that is uploaded to the Maven central repo is empty and does not contain the lib directory. That’s why it can not find the natives.

Seems something is broken while migrating from Bintray to Maven central.

Edit:

Filled an issue on GitHub page

3 Likes

That’s true though , it doesn’t include the native module ‘decodejme’ , it just has only a META-INF folder , but the jar file isn’t actually corrupted.

For now, you can use the jme3-android-native:3.4.0-alpha3 from Bintray. Audio should work fine in that release.

1 Like

i get this

com.jme3.asset.AssetLoadException: An exception has occurred while loading asset: AssetsForRenderer/Audio/shocks.ogg (Stream/Cache)

EDIT :

Okay , it has worked with .wav files but this is a converted ogg from wav , it cannot be loaded , although the ogg file runs well with VLC

Did you add jme3-jogg in your build.gradle dependencies?

1 Like

Hmm, never mind, I guess jme3-jogg is only for desktop and not needed in android.

Can you try with ogg files in jme-testdata?

1 Like

i have tried this now , it didn’t work.

Just tried with jmonkeyengine/Ocean Waves.ogg at master · jMonkeyEngine/jmonkeyengine · GitHub and it works fine for me.

Note I tried with JME 3.4.0-alpha3.

1 Like

Okay , thanks , i will try this.

Please re-test using v3.4.0-alpha6

2 Likes

It works fine for me. Thanks

By the way, I do not see v3.4.0-alpha6 in https://mvnrepository.com/artifact/org.jmonkeyengine/jme3-android-native, is that intentional or will it take some time to get listed? (Never mind, they have appeared now)

Also, I notice the jar size has increased from 1.1MB in alpha1 to 3.6MB in alpha6. Can be because of turning off the optimization flag on native code?

2 Likes

Yep it works fine , thanks @sgold .

1 Like

So what about this issue , now , seems the same but it’s since 2020 !

1 Like

the jar size has increased from 1.1MB in alpha1 to 3.6MB in alpha6. Can be because of turning off the optimization flag on native code?

That seems entirely possible.

So what about this issue , now , seems the same but it’s since 2020 !

Multiple issues can have the same symptoms but different root causes. What’s the root cause of issue 1294?

2 Likes

Idk , you should probably ask @Darkchaos to how to reproduce it , so we could have probably a good idea of its root cause , but i think this problem (module not found) wouldn’t have too much causes , it may be a network cause (like : libraries get corrupted while fetching from the central repo).