Error reading file: uiskin.json - only on Android -


i have been using default uiskin pack menu screen:

github: libgdx/test/gdx-tests-android/assets/data

  • uiskin.atlas
  • uiskin.json
  • uiskin.png
  • default.png
  • default.fnt

this works on desktop. on android, serializationexception:

fatal exception: glthread 3432 process: com.ttocsneb.matrix.android, pid: 1506 com.badlogic.gdx.utils.serializationexception: error reading file: skins/uiskin.json @ com.badlogic.gdx.scenes.scene2d.ui.skin.load(skin.java:97) @ com.badlogic.gdx.scenes.scene2d.ui.skin.<init>(skin.java:82) @ com.ttocsneb.matrix.screen.menuscreen.show(menuscreen.java.35) ... 

the error comes initialization of skin:

skin = new skin(gdx.files.internal("uiskin.json"), new  textureatlas("uiskin.atlas")); 

you can not use string path directly. try pass string through gdx.files.internal().

skin = new skin(gdx.files.internal("uiskin.json"), new  textureatlas(gdx.files.internal("uiskin.atlas"))); 

Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -