Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't load shared library GDX Freetype Mac

Tags:

java

macos

libgdx

I've recently switched to Mac OSX, and when opening a project that I was developing on Windows, I get this error:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'libgdx-freetype64.dylib' for target: Mac OS X, 64-bit
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:115)
at com.badlogic.gdx.graphics.g2d.freetype.FreeType.initFreeType(FreeType.java:541)
at com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.<init>(FreeTypeFontGenerator.java:102)
at com.evh98.lithium.ui.Central.load(Central.java:43)
at com.evh98.lithium.Lithium.create(Lithium.java:60)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:136)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Unable to read file for extraction: libgdx-freetype64.dylib
at com.badlogic.gdx.utils.SharedLibraryLoader.readFile(SharedLibraryLoader.java:124)
at com.badlogic.gdx.utils.SharedLibraryLoader.loadFile(SharedLibraryLoader.java:245)
at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:113)
... 6 more

Any help would be greatly appreciated, thanks in advance.

like image 717
EVH98 Avatar asked May 26 '14 19:05

EVH98


1 Answers

With LibGDX 1.9.6, you need to make sure to add the proper dependencies in build.gradle

https://github.com/libgdx/libgdx/wiki/Dependency-management-with-Gradle#freetypefont-gradle

FreeTypeFont Gradle

Core Dependency:

compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion"

Desktop Dependency:

compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"

like image 54
TalkLittle Avatar answered Nov 03 '22 01:11

TalkLittle