4

When I am compiling LibGdx project I am getting the below exception.

My question here is why it is coming and how to resolve this?

Libgdx: 0.9.9

com.badlogic.gdx.utils.GdxRuntimeException: No com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle registered with name: default

Json File

{
com.badlogic.gdx.graphics.g2d.BitmapFont: { default-font: { file: default.fnt } },
com.badlogic.gdx.graphics.Color: {
    green: { a: 1, b: 0, g: 1, r: 0 },
    white: { a: 1, b: 1, g: 1, r: 1 },
    red: { a: 1, b: 0, g: 0, r: 1 },
    black: { a: 1, b: 0, g: 0, r: 0 }
},
com.badlogic.gdx.scenes.scene2d.ui.Skin$TintedDrawable: {
    dialogDim: { name: white, color: { r: 0, g: 0, b: 0, a: 0.45 } }
},
com.badlogic.gdx.scenes.scene2d.ui.Button$ButtonStyle: {
    default: { down: default-round-down, up: default-round },
    toggle: { down: default-round-down, checked: default-round-down, up: default-round }
},
com.badlogic.gdx.scenes.scene2d.ui.TextButton$TextButtonStyle: {
    default: { down: default-round-down, up: default-round, font: default-font, fontColor: white },
    toggle: { down: default-round-down, up: default-round, checked: default-round-down, font: default-font, fontColor: white, downFontColor: red }
},
com.badlogic.gdx.scenes.scene2d.ui.SelectBox$SelectBoxStyle: {
    default: { font: default-font, fontColor: white, background: default-select, scrollStyle: default, listStyle: { font: default-font, selection: default-select-selection } }
},
com.badlogic.gdx.scenes.scene2d.ui.SplitPane$SplitPaneStyle: {
    default-vertical: { handle: default-splitpane-vertical },
    default-horizontal: { handle: default-splitpane }
},
com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: {
    default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large }
},
com.badlogic.gdx.scenes.scene2d.ui.Window$WindowStyle: {
    default: { titleFont: default-font, background: default-window, titleFontColor: white },
    dialog: { titleFont: default-font, background: default-window, titleFontColor: white, stageBackground: dialogDim }
},
com.badlogic.gdx.scenes.scene2d.ui.Slider$SliderStyle: {
    default-horizontal: { background: default-slider, knob: default-slider-knob }
},
com.badlogic.gdx.scenes.scene2d.ui.Label$LabelStyle: {
    default: { font: default-font, fontColor: white }
},
com.badlogic.gdx.scenes.scene2d.ui.TextField$TextFieldStyle: {
    default: { selection: selection, background: textfield, font: default-font, fontColor: white, cursor: cursor }
},
com.badlogic.gdx.scenes.scene2d.ui.CheckBox$CheckBoxStyle: {
    default: { checkboxOn: check-on, checkboxOff: check-off, font: default-font, fontColor: white }
},
com.badlogic.gdx.scenes.scene2d.ui.List$ListStyle: {
    default: { fontColorUnselected: white, selection: default-rect-pad, fontColorSelected: white, font: default-font }
},
com.badlogic.gdx.scenes.scene2d.ui.Touchpad$TouchpadStyle: {
    default: { background: default-pane, knob: default-round-large }
},
com.badlogic.gdx.scenes.scene2d.ui.Tree$TreeStyle: {
    default: { minus: tree-minus, plus: tree-plus, selection: default-select-selection }
}
}

Update: I have updated my projects libgdx to latest(nightly build) and now I am getting different exception [com.badlogic.gdx.utils.GdxRuntimeException: Invalid line: ] and the exception detail is below.

Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: Error reading pack file: images/uiskin.atlas
    at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:178)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:222)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:217)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:207)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.<init>(TextureAtlas.java:202)
    at com.pactpub.libgdx.canyonbunny.screens.MenuScreen.rebuildStage(MenuScreen.java:72)
    at com.pactpub.libgdx.canyonbunny.screens.MenuScreen.show(MenuScreen.java:348)
    at com.badlogic.gdx.Game.setScreen(Game.java:61)
    at com.pactpub.libgdx.canyonbunny.CanyonBunnyMain.create(CanyonBunnyMain.java:15)
    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: Invalid line: <html class="   ">
    at com.badlogic.gdx.graphics.g2d.TextureAtlas.readValue(TextureAtlas.java:426)
    at com.badlogic.gdx.graphics.g2d.TextureAtlas$TextureAtlasData.<init>(TextureAtlas.java:111)
MduSenthil
  • 2,019
  • 3
  • 18
  • 39
  • 1
    Show us the json you are using for the style of the ScrollPane and sho us the ScrollPane creation. Else we need a new big marble to take a look at your code. – bemeyer Apr 15 '14 at 07:20
  • Thanks BenX! I have updated with JSON file which I am using. – MduSenthil Apr 15 '14 at 08:50

1 Answers1

1

Taken from the latest uiskin.json from the tests.

com.badlogic.gdx.scenes.scene2d.ui.ScrollPane$ScrollPaneStyle: { default: { vScroll: default-scroll, hScrollKnob: default-round-large, background: default-rect, hScroll: default-scroll, vScrollKnob: default-round-large } },

Try to insert this in your uiskin.json and it might work. There have been several changes to the ScrollPane though and it might not work anymore with the old 0.9.9. You should consider using the latest version libgdx (nightly build).

noone
  • 19,520
  • 5
  • 61
  • 76
  • I have tried this but not working. Still error persists! Thanks for your answer. – MduSenthil Apr 15 '14 at 08:51
  • I have used the latest version(nightly build) and now i am getting a different exception. Updated Exception details in the Question. – MduSenthil Apr 15 '14 at 10:36
  • 1
    Are you using all files from the test folder which I linked in my answer? If you use uiskin.json, uiskin.atlas and uiskin.png it should work. – noone Apr 15 '14 at 11:18
  • Yes. I have used all the files uiskin.atlas,uiskin.png and uiskin.json. But still not working. – MduSenthil Apr 15 '14 at 11:30
  • 1
    OMG! Fault is mine! Sorry @noone! I have made a blunder by saving those files using browser's "Save link as" and all of them are saved as html files. Thanks for your time and the hold ("it should work") you have on libgdx! – MduSenthil Apr 15 '14 at 11:43