Question

i am creating a game using libGDX for android and desktop PCs. For transition screens, I am making use of Universal Tween engine. The desktop version runs perfectly but whenever I try running the android version, I get a Fatal Exception. The exception occurs as NoClassDefFoundfor SpriteTween class but it exists and is successfully detected in my desktop game.

03-03 11:04:17.192: I/System.out(21831): TOUCHED
03-03 11:04:19.264: I/System.out(21831): Click: Level2
03-03 11:04:19.264: I/dalvikvm(21831): Could not find method aurelienribon.tweenengine.TweenManager.update, referenced from method com.DC.my_packet_journey.TransitionScreen2.render
03-03 11:04:19.264: W/dalvikvm(21831): VFY: unable to resolve virtual method 241: Laurelienribon/tweenengine/TweenManager;.update (F)V
03-03 11:04:19.264: D/dalvikvm(21831): VFY: replacing opcode 0x6e at 0x0011
03-03 11:04:19.264: I/dalvikvm(21831): Failed resolving Lcom/DC/my_packet_journey/SpriteTween; interface 88 'Laurelienribon/tweenengine/TweenAccessor;'
03-03 11:04:19.264: W/dalvikvm(21831): Link of class 'Lcom/DC/my_packet_journey/SpriteTween;' failed
03-03 11:04:19.264: E/dalvikvm(21831): Could not find class 'com.DC.my_packet_journey.SpriteTween', referenced from method com.DC.my_packet_journey.TransitionScreen2.show
03-03 11:04:19.264: W/dalvikvm(21831): VFY: unable to resolve new-instance 127 (Lcom/DC/my_packet_journey/SpriteTween;) in Lcom/DC/my_packet_journey/TransitionScreen2;
03-03 11:04:19.264: D/dalvikvm(21831): VFY: replacing opcode 0x22 at 0x004a
03-03 11:04:19.264: I/dalvikvm(21831): Failed resolving Lcom/DC/my_packet_journey/SpriteTween; interface 88 'Laurelienribon/tweenengine/TweenAccessor;'
03-03 11:04:19.264: W/dalvikvm(21831): Link of class 'Lcom/DC/my_packet_journey/SpriteTween;' failed
03-03 11:04:19.264: D/dalvikvm(21831): DexOpt: unable to opt direct call 0x01f2 at 0x4c in Lcom/DC/my_packet_journey/TransitionScreen2;.show
03-03 11:04:19.274: D/dalvikvm(21831): DexOpt: unable to opt direct call 0x00f0 at 0x54 in Lcom/DC/my_packet_journey/TransitionScreen2;.show
03-03 11:04:19.274: I/dalvikvm(21831): Failed resolving Lcom/DC/my_packet_journey/TransitionScreen2$1; interface 89 'Laurelienribon/tweenengine/TweenCallback;'
03-03 11:04:19.274: W/dalvikvm(21831): Link of class 'Lcom/DC/my_packet_journey/TransitionScreen2$1;' failed
03-03 11:04:19.274: D/dalvikvm(21831): DexOpt: unable to opt direct call 0x0261 at 0x5b in Lcom/DC/my_packet_journey/TransitionScreen2;.show
03-03 11:04:19.274: I/dalvikvm(21831): DexOpt: unable to optimize static field ref 0x000b at 0x6a in Lcom/DC/my_packet_journey/TransitionScreen2;.show
03-03 11:04:19.304: W/dalvikvm(21831): threadid=11: thread exiting with uncaught exception (group=0x41dfe8b0)
03-03 10:35:23.918: E/AndroidRuntime(20079): FATAL EXCEPTION: GLThread 14763
03-03 10:35:23.918: E/AndroidRuntime(20079): java.lang.NoClassDefFoundError: com.DC.my_packet_journey.SpriteTween
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.DC.my_packet_journey.TransitionScreen5.show(TransitionScreen5.java:67)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.badlogic.gdx.Game.setScreen(Game.java:62)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.DC.my_packet_journey.PagedScrollPaneTest$1.clicked(PagedScrollPaneTest.java:226)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.badlogic.gdx.scenes.scene2d.utils.ClickListener.touchUp(ClickListener.java:84)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.badlogic.gdx.scenes.scene2d.InputListener.handle(InputListener.java:57)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.badlogic.gdx.scenes.scene2d.Stage.touchUp(Stage.java:343)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.badlogic.gdx.backends.android.AndroidInput.processEvents(AndroidInput.java:360)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:498)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
03-03 10:35:23.918: E/AndroidRuntime(20079):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

LibGDX makes use of same base code for either version. So technically if the desktop version works, the android version should work as well.

I have added more entries from the logCat, I suppose all this is happening due to failed to Link class of SpriteTween. Why is this only happening on android?

Was it helpful?

Solution

I referred this question here. Turns out that in my android project buildpath>order & export the android 4.0.3 tag was unchecked. By checking that box, my problem was solved.

Like stuntmania mentioned, the problem was not with the tween engine but in my build path. The dalvik machine failed to detect appropriate libraries and hence only the android version was not working while the desktop version was running perfectly.

build path

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top