Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libgdx couldnt load shared library gdx freetype for target linux 32bit, how do I fix?

I have started using libgdx and have been trying to get the freetypefont working on Android but no matter how hard I try I cannot seem to get it working. My app was working perfectly fine until I tried using freetypefont. I have put the extensions in as directed on the libgdx web site. The app crashes or stops working as soon as it starts.

The console says couldn't load shared library gdx-freetype for target linux 32-bit. I feel like I have tried everything. I have put the two freetype and freetype native files into the main game libs, I have put them into the desktop and only put the freetype one into the android lib. I have used the latest nightly build .so files for the armeabi folders and still nothing. I have also included the nightly build .so file for the x86 folder as suggested on here and still nothing. If anyone has anything on this please help. Thanks.

like image 626
user2002077 Avatar asked Feb 14 '23 21:02

user2002077


2 Answers

You have to add what is listed here for each project dependency in your build.gradle file.

implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64"

like image 106
Carlo Espino Avatar answered Feb 16 '23 10:02

Carlo Espino


I've got a game using the same libraries running just fine. Here's the library information (using 'file') for the libraries that work:

libs/armeabi/libgdx-freetype.so:     ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, stripped
libs/armeabi-v7a/libgdx-freetype.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, stripped

Check that you've got the proper libs and it should work just fine. FWIW, I'm running the nightlies (1.0-SNAPSHOT).

You might also want to check that you are running on ARM Android, since that is what those libraries are for. If you're running on x86 Android I am not sure that the freetype extension is supported.

like image 40
Marius Kjeldahl Avatar answered Feb 16 '23 11:02

Marius Kjeldahl