0

My program is crashing with a

03-05 02:21:57.127: E/dalvikvm(12583): Could not find class 'com.deerandcatgames.spikeJumper.GUI.OuyaTable$1', referenced from method com.deerandcatgames.spikeJumper.GUI.OuyaTable.<init>

Whenever I run it on android, from the desktop project, it runs fine.

I look at the logcat, and I find the following errors:

03-05 02:21:56.907: I/SpikeJumper(12583): Showing screen: SplashScreen
03-05 02:21:56.957: D/dalvikvm(12583): GC_FOR_ALLOC freed 23K, 5% free 7525K/7920K, paused 37ms, total 37ms
03-05 02:21:57.127: W/dalvikvm(12583): Unable to resolve superclass of Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable$1; (347)
03-05 02:21:57.127: W/dalvikvm(12583): Link of class 'Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable$1;' failed
03-05 02:21:57.127: E/dalvikvm(12583): Could not find class 'com.deerandcatgames.spikeJumper.GUI.OuyaTable$1', referenced from method com.deerandcatgames.spikeJumper.GUI.OuyaTable.<init>
03-05 02:21:57.127: W/dalvikvm(12583): VFY: unable to resolve new-instance 992 (Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable$1;) in Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable;
03-05 02:21:57.127: D/dalvikvm(12583): VFY: replacing opcode 0x22 at 0x0016
03-05 02:21:57.127: I/dalvikvm(12583): Could not find method com.badlogic.gdx.controllers.Controllers.removeListener, referenced from method com.deerandcatgames.spikeJumper.GUI.OuyaTable.dispose
03-05 02:21:57.127: W/dalvikvm(12583): VFY: unable to resolve static method 2760: Lcom/badlogic/gdx/controllers/Controllers;.removeListener (Lcom/badlogic/gdx/controllers/ControllerListener;)V
03-05 02:21:57.127: D/dalvikvm(12583): VFY: replacing opcode 0x71 at 0x0007
03-05 02:21:57.127: W/dalvikvm(12583): Unable to resolve superclass of Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable$1; (347)
03-05 02:21:57.127: W/dalvikvm(12583): Link of class 'Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable$1;' failed
03-05 02:21:57.137: D/dalvikvm(12583): DexOpt: unable to opt direct call 0x26b5 at 0x18 in Lcom/deerandcatgames/spikeJumper/GUI/OuyaTable;.<init>
03-05 02:21:57.187: D/dalvikvm(12583): GC_CONCURRENT freed 399K, 8% free 7578K/8236K, paused 3ms+5ms, total 29ms
03-05 02:21:57.257: I/SpikeJumper(12583): Setting up custom table
03-05 02:21:57.257: W/dalvikvm(12583): threadid=11: thread exiting with uncaught exception (group=0x418a3930)
03-05 02:21:57.257: E/AndroidRuntime(12583): FATAL EXCEPTION: GLThread 19356
03-05 02:21:57.257: E/AndroidRuntime(12583): java.lang.NoClassDefFoundError: com.deerandcatgames.spikeJumper.GUI.OuyaTable$1
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.deerandcatgames.spikeJumper.GUI.OuyaTable.<init>(OuyaTable.java:72)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.deerandcatgames.spikeJumper.screens.AbstractScreen.getTable(AbstractScreen.java:84)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.deerandcatgames.spikeJumper.screens.AbstractScreen.resize(AbstractScreen.java:52)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.deerandcatgames.spikeJumper.screens.SplashScreen.resize(SplashScreen.java:49)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.badlogic.gdx.Game.setScreen(Game.java:63)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.deerandcatgames.spikeJumper.SpikeJumper.setScreen(SpikeJumper.java:61)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.deerandcatgames.spikeJumper.SpikeJumper.resize(SpikeJumper.java:79)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:334)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505)
03-05 02:21:57.257: E/AndroidRuntime(12583):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

The OuyaTable is

public class OuyaTable extends Table {
....
}

I have tried everything I can think of, and it still will not run on the android. Has anyone seen this before, and/or knows how to fix it?

KatGaea
  • 996
  • 1
  • 12
  • 31
  • Perhaps `Table` (which `OuyaTable` extends from) is not available in Android? –  Mar 05 '13 at 03:00
  • it is, this is why I had libgdx in the tags, as Table is a LibGDX class, `com.badlogic.gdx.scenes.scene2d.ui.Table` – KatGaea Mar 05 '13 at 03:04
  • Did you put your libraries (`*.jar`s) in `/libs` folder? –  Mar 05 '13 at 03:11
  • Yes I did. `/libs` contains `gdx-backend-android.jar` and `gdx-controllers.jar` they are also added through eclipse, and checked in the export dialog. I double checked with a fresh working new project, it does not have `gdx.jar` added through the android project's `\libs` and instead the base project – KatGaea Mar 05 '13 at 03:15

3 Answers3

1

Okay, trying again but paying more attention to the error messages... I see:

Could not find method com.badlogic.gdx.controllers.Controllers.removeListener, referenced from method com.deerandcatgames.spikeJumper.GUI.OuyaTable.dispose

As one of the reasons the link failed. I think you must be using the libgdx "controllers" extension ... you need to add the gdx-controllers-android.jar. See the "Integration Into Your Project" section of the badlogic blog: http://www.badlogicgames.com/wordpress/?p=2724

P.T.
  • 24,557
  • 7
  • 64
  • 95
  • That is also added in. I forgot to mention that in the thing sorry. – KatGaea Mar 05 '13 at 17:46
  • Okay marking this as the answer, because it was SO close to the actual problem, I HAD included `gdx-controllers-android.jar` ... I just forgot to include `gdx-controllers.jar` Stupid mistake I know. – KatGaea Mar 07 '13 at 17:06
0

The gdx.jar (which contains the platform-independent Libgdx classes) probably didn't get packaged into your Android .APK. (Versus the Android-specific Libgdx classes which are packaged in gdx-backend-android.jar and did seem to make it into your .APK.)

You need to make sure your Android project is exporting the gdx.jar. Right-click on your Android project in Project Explorer, select Properties, select Java Build Path, and select the Order and Export tab. Make sure gdx.jar and gdx-backend-android.jar are both "checked" (along with your common project).

P.T.
  • 24,557
  • 7
  • 64
  • 95
  • It is checked, that was one of the first things I checked, but it still seems to fail. – KatGaea Mar 05 '13 at 17:15
  • Which version of the Android Dev Tools are you using? (There were some weird build problems with ADT17). Which Libgdx version? – P.T. Mar 05 '13 at 17:34
  • LibGDX nightly, and v21 of the ADT. It fails though even with latest stable, 0.9.8. – KatGaea Mar 05 '13 at 18:52
-1

java=caca, adt=caca, eclipse=..... I 've had this problem, solved changing the main project (star-assault in the tutorial) from java 1.7 to java 1.6 after getting mad for couple of hours...

guigui
  • 1