lib gdx json在android中读取错误

时间:2015-07-31 08:25:10

标签: java android json intellij-idea libgdx

请帮助!! 我正试图在InteliJ的想法中使用libgdx库创建一个游戏。现在我正在使用scene2d创建我的游戏的主菜单UI。当我在桌面上运行我的项目它没有错误但是当我尝试在Android设备上运行它时会出现以下错误,下面是logcat响应和skin.json中使用的代码

 //code
    {
          com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file:      cute.fnt } },
          com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
           default: { down: default-round-down, up: default-round, font: default-font },
          },
          com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
            default:  {
             titleFont: default-font
             }
           }
        }

这是logcat响应

07-31 15:50:08.004  13046-13069/com.game.new.android E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 5537
com.badlogic.gdx.utils.SerializationException: Error reading file: uiskin.json
        at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:97)
        at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Skin.java:74)
        at com.game.new.new.create(new.java:37)
        at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1640)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1363)
 Caused by: com.badlogic.gdx.utils.SerializationException: Error reading 

file: uiskin.json
            at com.badlogic.gdx.utils.Json.fromJson(Json.java:683)
            at com.badlogic.gdx.scenes.scene2d.ui.Skin.load(Skin.java:95)
            at com.badlogic.gdx.scenes.scene2d.ui.Skin.<init>(Skin.java:74)
            at com.game.new.new.create(new.java:37)
            at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241)
                at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1640)
                at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1363)
         Caused by: com.badlogic.gdx.utils.SerializationException: Serialization trace:
        down (com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle)
                at com.badlogic.gdx.utils.Json.readFields(Json.java:787)
                at com.badlogic.gdx.utils.Json.readValue(Json.java:902)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin$1.readValue(Skin.java:404)
                at com.badlogic.gdx.utils.Json.readValue(Json.java:834)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin$2.readNamedObjects(Skin.java:425)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin$2.read(Skin.java:414)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin$2.read(Skin.java:410)
                at com.badlogic.gdx.utils.Json.readValue(Json.java:873)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin$1.readValue(Skin.java:404)
                at com.badlogic.gdx.utils.Json.fromJson(Json.java:681)
                ... 6 more
         Caused by: com.badlogic.gdx.utils.GdxRuntimeException: No Drawable, NinePatch, TextureRegion, Texture, or Sprite registered with name: default-round-down
                at com.badlogic.gdx.scenes.scene2d.ui.Skin.getDrawable(Skin.java:283)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin.get(Skin.java:139)
                at com.badlogic.gdx.scenes.scene2d.ui.Skin$1.readValue(Skin.java:403)
                at com.badlogic.gdx.utils.Json.readFields(Json.java:780)
                ... 15 more

0 个答案:

没有答案