Maqueda
Maqueda

Reputation: 85

Error with FreeFontTypeGenerator using Libgdx

I have an issue when I try to use the extension for TrueType fonts. I've done the steps that everyone can find in the official docs. I've copied and linked the jars following the instructions in https://github.com/libgdx/libgdx/wiki/Gdx-freetype . And when I try to use it, there are some problems.

Seems to miss some method or something. Here is the error:

    Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoSuchMethodError: com.badlogic.gdx.graphics.glutils.PixmapTextureData.<init>(Lcom/badlogic/gdx/graphics/Pixmap;Lcom/badlogic/gdx/graphics/Pixmap$Format;ZZZ)V
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:120)
Caused by: java.lang.NoSuchMethodError: com.badlogic.gdx.graphics.glutils.PixmapTextureData.<init>(Lcom/badlogic/gdx/graphics/Pixmap;Lcom/badlogic/gdx/graphics/Pixmap$Format;ZZZ)V
at com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.generateData(FreeTypeFontGenerator.java:420)
at com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.generateData(FreeTypeFontGenerator.java:260)
at com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.generateFont(FreeTypeFontGenerator.java:133)
at com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator.generateFont(FreeTypeFontGenerator.java:145)
at com.neurodigital.babyeduca.MainScreen.show(MainScreen.java:142)
at com.badlogic.gdx.Game.setScreen(Game.java:62)
at com.neurodigital.babyeduca.LoadingScreen.render(LoadingScreen.java:26)
at com.badlogic.gdx.Game.render(Game.java:46)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:207)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

Could someone give me a tip? I've already lost 2 days trying to fix this.

Upvotes: 0

Views: 424

Answers (1)

Chase
Chase

Reputation: 3183

It looks like PixmapTextureData constructors are being modified, if I compare 0.9.9 with the nightly API there is a new constructor. And given that LibGDX will introduce breaking changes...are you mixing versions? Not using the extension that was a part of your LibGDX download? Try getting the latest nightly and make sure you use the extensions from it or try with 0.9.9. You might have to recreate your projects and copy your code and assets over.

Upvotes: 2

Related Questions