raeleus/skin-composer

Null Pointer Exception While Generating Drawables

Closed this issue · 2 comments

We have a long-running project where we are recently getting an error importing our skin into the skin composer. The error is:

com.ray3k.skincomposer.data.AtlasData: Error while attempting to generate drawables.
java.lang.NullPointerException
    at com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable.setSprite(SpriteDrawable.java:75)
    at com.badlogic.gdx.scenes.scene2d.utils.SpriteDrawable.<init>(SpriteDrawable.java:36)
    at com.ray3k.skincomposer.data.AtlasData.produceAtlas(AtlasData.java:450)
    at com.ray3k.skincomposer.dialog.DialogImport.lambda$importFile$6(DialogImport.java:211)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:154)
    at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.<init>(Lwjgl3Application.java:114)
    at com.ray3k.skincomposer.desktop.DesktopLauncher.main(DesktopLauncher.java:405)

To debug this we have attempted to "save as" the project and reload it. The error still persists. I also attempted to run the skin composer via android studio's debugger to determine which drawable is causing problems, but this error did not occur when I did that.

Any idea what could be causing this issue?

Update:

We discovered this issue occurs only on the windows OS and was related to drawable names being identical in the windows non-case-sensitive filesystem. Our project involves contributors on a variety of OS's which is how this issue happened. I'm not sure if this is something you can easily address in the skin composer. I'll leave the issue open for now, but happy to close if you'd prefer.

Sorry for keeping this open for too long. I can't easily resolve this one. Good detective work, but I'll consider addressing this if I ever get around to refactoring the entire project. Thanks for the report!