When I write my jME game code I use the jME sdk to create my game which means I need a jar library added and hence it is build using ANT.
When I am happy to test my game on android I will create an android application in android studio which uses gradle and I reference the jme/heart/minie gradle dependencies there for the android build.
Before I rebuild the native libraries again, let’s see if we can persuade the NDK to include the shared libc++ runtime in your game. Instructions are here. Would you try that for me please, if you haven’t already?
Can you please assist in how I should configure the CMakeLists.txt file to accommodate for the C++ build?
This is what error I am getting on the txt file:
release|x86_64 :C:/work-proto/jme-minie-test/jme-minie-android/app/CMakeLists.txt:1:
release|x86_64 :Parse error. Expected a command name, got unquoted argument with text "ANDROID_STL='c++_shared'".
I think the CMakeLists.txt can be empty for now. Or if Android Studio insists on non-empty, add some harmless command like cmake_minimum_required(VERSION 3.0).
I believe we don’t want any addLibrary() commands in the CMakeLists.txt file, since both native libraries (libbulletjme.so and libc++_shared.so) are pre-built.
The key thing, I think, is to set android.defaultConfig.externalNativeBuild.cmake.arguments in the build.gradle file to 'ANDROID_STL=c++_shared'
I’d feel more confident if I could find a clear example of this, or at least something similar, on the Web.
I have done this and my code with the cmake stuff compiles now except it still gives the error:
E/AndroidRuntime: FATAL EXCEPTION: GLThread 1991
Process: com.jme.minie.tests, PID: 18822
java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1071)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at com.jme.minie.tests.MainApplication.initPhysics(MainApplication.java:43)
at com.bruynhuis.galago.app.BaseApplication.simpleUpdate(BaseApplication.java:424)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:258)
at com.jme3.app.AndroidHarness.update(AndroidHarness.java:496)
at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:354)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1573)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1272)
E/com.jme3.app.AndroidHarness: SEVERE Exception thrown in Thread[GLThread 1991,5,main]
java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
I recommend using the copies under “ndk/21.0.6113669/sources/cxx-stl/llvm-libc++/libs” since the Minie native libraries were compiled using that version of the NDK.