简体   繁体   中英

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.

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"

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.

The problem I had was that for some reason libgdx.so was not copied to any of the armeabi , armeabi-v7a or x86 folders in the android project's lib folder.

Copying these over from the libgdx distribution worked for me.

The setup-ui program simply copies things over from the libgdx distribution for you. You can find these folders there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM