libgdx / gdx-jnigen

jnigen is a small library that can be used with or without libGDX which allows C/C++ code to be written inline with Java source code.
Apache License 2.0
60 stars 25 forks source link

Problem with SharedLibraryLoader#mapLibraryName on Android? #22

Closed jochenreutelshoefer closed 3 years ago

jochenreutelshoefer commented 3 years ago

Hi,

I came across problems when loading a shared library on Android (I was trying to setup FreeType). The log tells me: "Couldn't load shared library 'gdx-freetype' for target: Linux, 32-bit" I debugged a little and found that in my case the method mapLibraryName() returns the same String that was handed over ("gdx-freetype"). It seems to me, that the method mapLibraryName() does not work properly (on Android) as for Android devices 'isLinux' is set to false when 'isAndroid' is set to true when checking the runtime name. But.... 'isAndroid' is not used in mapLibraryName() at all. I am using Libgdx 1.9.12 and was testing on an old Nexus 6 with Android 6. Is this a general issue or maybe just related to the old SDK version that I was using?

Best Regards, Jochen

PokeMMO commented 3 years ago

The error message is simply wrong, the actual functionality is correct.

Make sure you have the correct .so in your application's lib folder. You probably want to verify ANDROID/libs/armeabi-v7a/libgdx-freetype.so exists. It should be created by gradle.