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

岁酱吖の 提交于 2019-12-12 12:09:34

问题


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.


回答1:


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"




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/21561004/libgdx-couldnt-load-shared-library-gdx-freetype-for-target-linux-32bit-how-do-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!