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
Post a Comment