• Editor
  • [solved] Strange error with libGDX runtime

Related Discussions
...

Maybe you will know the cause / solution - since updating libGDX to the latest nightly I have a crash:

04-16 13:33:28.789: E/AndroidRuntime(31202): FATAL EXCEPTION: GLThread 3326
04-16 13:33:28.789: E/AndroidRuntime(31202): java.lang.NoSuchMethodError: com.badlogic.gdx.graphics.Color.set
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at com.esotericsoftware.spine.Animation$ColorFrames.apply(Animation.java:402)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at com.esotericsoftware.spine.Animation.apply(Animation.java:43)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at magory.heroes.MaAnimatedPhysElement.updateAnimation(MaAnimatedPhysElement.java:148)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at magory.heroes.LHGame.updateAnimations(LHGame.java:737)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at magory.heroes.LHGame.update(LHGame.java:539)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at magory.lib.MaApp.render(MaApp.java:244)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at magory.heroes.LHApp.render(LHApp.java:105)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:487)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
04-16 13:33:28.789: E/AndroidRuntime(31202): 	at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

The same crash occurs in box2Dlights and only in this one function (setting color using four floats) - avoiding Color.set(float r, float g, float b, float a) makes box2Dlights work...

I will probably modify Spine runtime code for now so it doesn't use that function but it's a very strange problem. People at libGDX blame my setup. 🙂 But nothing in my setup changed and I use armeabi and all libgdx jar files in the newest versions.

The latest spine-libgdx from github compiles and runs with the latest libgdx from github. It really must be your setup. 🙂

It appears the problems is only when I use jar files. When I use source and add things as a project it works fine. So for now I've maganaged to workaround it. Maybe one day I'll discover what was the real source of the problem.

Apparently the JAR files don't contains the classes you think they do.

Solved! I realised what is happening - the old Spine JAR and box2DLight JAR is expecting a method set(float r, float g, float b, float a) in libGDX Color class that returns void while in new libGDX it returns Color. Function set(Color c) works because it was already returning Color.