LibGDX FreeTypeFontGenerator NoClassDefFoundError

时间:2016-01-10 22:57:05

标签: java android libgdx

有一个生成BitmapFont的方法

public BitmapFont GenerateFNTs(String pathToTTF, int fontSize) {
    fontHandle = Gdx.files.internal(pathToTTF);
    generator = new FreeTypeFontGenerator(fontHandle);
    parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
    parameter.size = fontSize;

    bitmapFont = generator.generateFont(parameter);
    generator.dispose();
    return bitmapFont;
}

跑完后他们给我一个例外:

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoClassDefFoundError: com/badlogic/gdx/graphics/g2d/PixmapPacker$PackStrategy
    at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:127)
Caused by: java.lang.NoClassDefFoundError: com/badlogic/gdx/graphics/g2d/PixmapPacker$PackStrategy
    at com.pol.helpers.GenerateFNT.GenerateFNTs(GenerateFNT.java:19)

我做错了什么?

0 个答案:

没有答案