简体   繁体   English

Libgdx无法为目标linux 32bit加载共享库gdx freetype,我该如何解决?

[英]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. 我已经开始使用libgdx并且一直试图让freetypefont在Android上工作,但无论我怎么努力,我似乎​​无法让它工作。 My app was working perfectly fine until I tried using freetypefont. 我的应用程序工作得很好,直到我尝试使用freetypefont。 I have put the extensions in as directed on the libgdx web site. 我按照指示在libgdx网站上放了扩展名。 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. 控制台说无法加载目标Linux 32位的共享库gdx-freetype。 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. 我已将两个freetype和freetype本机文件放入主游戏库中,我已将它们放入桌面并仅将freetype一个放入android lib中。 I have used the latest nightly build .so files for the armeabi folders and still nothing. 我已经使用了armeabi文件夹的最新每晚构建.so文件,但仍然没有。 I have also included the nightly build .so file for the x86 folder as suggested on here and still nothing. 我还在这里提供了x86文件夹的每晚构建.so文件,但仍然没有。 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. 您必须在build.gradle文件中为每个项目依赖项添加此处列出内容

implementation "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" 实现“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”
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a" 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-arm64-v8a”
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86" natives“com.badlogicgames.gdx:gdx-freetype-platform:$ gdxVersion:natives-x86”
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86_64" 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: 这是有效库的库信息(使用'file'):

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). FWIW,我正在运行夜宵(1.0-SNAPSHOT)。

You might also want to check that you are running on ARM Android, since that is what those libraries are for. 您可能还想检查您是否在ARM Android上运行,因为这就是这些库的用途。 If you're running on x86 Android I am not sure that the freetype extension is supported. 如果您在x86 Android上运行,我不确定是否支持freetype扩展。

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. 我遇到的问题是由于某种原因libgdx.so没有被复制到android项目的lib文件夹中的任何armeabiarmeabi-v7ax86文件夹。

Copying these over from the libgdx distribution worked for me. 从libgdx发行版中复制这些内容对我有用。

The setup-ui program simply copies things over from the libgdx distribution for you. setup-ui程序只是为您复制libgdx发行版中的内容。 You can find these folders there. 你可以在那里找到这些文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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