As of November 1st all Android Apps targeting Android 15 will be required to support 16KB page sizes. When testing using JME3 on Android 15 with a 16KB page size it fails with the following error (shortened for brevity)
java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in “/data/app/~~PBKCdZDE1-DW9sm_bb4Xeg==…/lib/x86_64/libdecodejme.so” (new hash type from the future?)
I believe it is failing when trying to extract the OpenGL native libraries.
If I try the JME3 app in Android 15 with a 4kb page size it works fine. Are there any plans to have JME3 support 16KB page sizes or is there some sort of a build param I can use to resolve the issue? I don’t believe this is something I can control with build params but I could be wrong.
Thanks in advance for any help you can provide.
Hi, according to a related
opencv issue on github
, to support 16KB pages it’s required to re-compile android libraries with different build options. More information in the
related android developer page
I think that just rebuilding jme3 android natives using latest ndk (r27d) and setting ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=true would create libraries supporting 16kb pages…
If you have some spare time you could give it a try
Thank you joliver82. I was a bit confused thinking that the android-native library would be set up to somehow build with the ndk in Android Studio, but after downloading the JME3 source, it seems it builds it just using gradle from the command prompt. It seems you need to define an ANDROID_NDK environment variable as well. I will see if I can get something working. If I do I will post the jar here for others to use.
jme3 (including natives) is easy to build. Just edit the file gradle.properties to set buildNativeProjects = true and ndkPath = “the path where you installed the NDK”. Afterwards just run ,/gradlew build
Before doing so, change the Android.mk or Application.mk files inside jme3-android-native folder to add the build option for 16k support (not 100% sure those are the files to change)
You’ll need to include the resulting jars in your project instead of default jars from repository
I think this should do the trick. If it works, you could create a PR for it in the jme3 project
Thanks for taking the time to check this
Thanks again. I was able to figure that out after some research. I am using NDK 29.0.13599879. I decided to just do a build before even trying the 16kb support option but I cannot get the native libraries to build. I tried the latest JME3 from Github and then the 3.8.1 stable release and they both fail with the same errors. Initially it gives an error in the NativeVorbisFile.c class saying that implicit function declarations are not allowed (memcpy). I was able to get around that issue by including string.h but then I got an error in OpenAlSoftNativeLib in it’s optional class that I do not know how to resolve. I think over the weekend I will try to figure out what is the most recent version of the NDK that I can successfully build with and then see if it support 16kb pages. Unless only the r29 one does, in which case we’re doomed. I noticed the sample NDK path in JME3 is r7 so there’s a LOT of changes between 7 and 29.
Update: I am building on Windows so I had to install CMake (latest version works fine) and Make (the ancient GnuWin32 version). I applied RiccardoBlb’s fixes and was able to build successfully with NDK 29. (thank you both very much). When I tried to build my own app with the newly created android-native file I got an error that AndroidHarness was not defined. I checked around the JME3 build and I found that there is a jme-android jar in jme3-android/build/libs, so I added that to my app as well and that resolved that error. Unfortunately when I ran my app I got the following error: “java.lang.UnsatisfiedLinkError: dlopen failed: library “libc++_shared.so”” After doing some research I tried adding arguments “-DANDROID_STL=c++_shared” in the openalsoft.gradle file but that did not help. Then I found that two Application.mk files in the JME3 source have this in them: APP_STL := c++_static. I changed them to APP_STL := c++_shared and then my android app started working! So now at least I have working native libraries. My next step will be to try the 16KB alignment flag and see if it works. I am going into detail here in case someone with more experience building JME3 might know if I am potentially breaking other stuff.
Update to Update: On a whim I decided to just try the new build on the 16KB emulated device AND IT WORKED! Seems that building with NDK29 was sufficient to resolve the issue.
Apparently I cannot upload jar’s here. Let me know how to do that and I’ll share with the community.
I’m glad you got it working.
So in the end just updating openalsoft, setting “APP_STL := c++_shared” and using latest NDK did the trick without even setting ANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES var??
Did you try your app build in a previous android release? Maybe your build works properly in android 15 but not in previous releases
Yes, it’s not possible to upload files to the forum. To contribute to the community, I would advice you to create a PR for jme3 with the changes you did so next release of jme3 includes them and everyone will be capable of running jme3 in any newer android having the requirement of 16kb pages
I have uploaded the jar files to a file service so the community can see if they are working. There are two files. One is the jme3-android jar which has the AndroidHarness in it and the other is the jme3-android-native jar that has the actual native libs in it.
To use, one must remove this from your build.gradle:
implementation “org.jmonkeyengine:jme3-android-native:3.8.1-stable”
and add these:
implementation files(‘/jme3-android-3.8.0-SNAPSHOT.jar’)
implementation files(‘/jme3-android-native-3.8.0-SNAPSHOT.jar’)
The links are here:
https://owlcloudhost.com/drive/s/N3ldbn5KGEXK6g5ev0oAuOeD6mb6yc
https://owlcloudhost.com/drive/s/pzIVuXCD2dceoHfUD8DSd5UbyVOtlS
Note that even though these are called 3.8.0.SNAPSHOT, I actually used the 3.8.1 stable build to generate them (I don’t know why they aren’t called 3.8.1) I also have the feeling that the lower level calls to the OpenGL and Audio renderers probably don’t change that much so it might work with other builds. I have only done a quick test of my own app to see if they work and they did, but I do not use a lot of the API. let me know if this works for you or if there are issues. I’m not sure how much I can help if you have problems but I will try.
As you didn’t do it already, I took some spare time to create a PR for jME3 including the changes we’ve been talking about here:
Android 16kb openalsoft update by joliver82 · Pull Request #2552 · jMonkeyEngine/jmonkeyengine · GitHub
Thanks
@bzbit
for reporting and the effort and
@RiccardoBlb
for the NGEngine work.
Note that the docker image used for building jme3 android natives needs to be updated also. In fact, the android automatic building is failing for the PR
Hey all.
Anyone got this to work?
When I use the 2 custom android .jar’s it works when running the project in emulator, however when trying to upload to play store I get this issue:
Your app declares support for 'riscv64' architecture, but the following libraries are missing:[libbulletjme.so, libc++_shared.so, libopenalsoftjme.so]. Update your app to rely on libraries that support 'riscv64' architecture.
'riscv64' architecture is only supported for application targeting WearOS.
Any help would be much appreciated.
To resolve this issue, consider the following options:
Exclude riscv64 from ABI filters: If riscv64 support is not critical for your target audience or if you cannot update the problematic dependencies, you can explicitly exclude it in your build.gradle file.
android {
defaultConfig {
// ...
packagingOptions {
exclude 'lib/riscv64/**' // Exclude riscv64 native libraries
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' // Specify supported ABIs
Just checked and realized that all ABIs (including riscv64) are built for both libbufferallocatorjme.so and libdecodejme.so but libopenalsoftjme.so is restricted to arm and x86 only. I’ll update the PR to disable riscv64 when building those two libraries also
For the time being, if you need to upload your app right now, the best way to solve this is to disable riscv64 at the app level as you suggested
I’ll get back to you once updated. Thanks for the issue report 
No problem.
This is big for me, because I only have 2 days left to do this update and I have 8 apps on the play store.
Will this be something default in the future releases of jME? In jME3.9.0