Libgdx: Android application cannot find the main class of the game

I created three projects as described in http://code.google.com/p/libgdx/wiki/ProjectSetup and the working version of the desktop is working, but I get an error below when I launch the Android version for the emulator. The main project is in the build path of the android project, and eclipse builds everything without errors. What am I missing?

10-31 07:06:47.023: E/dalvikvm(769): Could not find class 'com.mygame.MyGame', referenced from method com.mygame.MyGameAndroid.onCreate 
+4
source share
3 answers

I solved this when I switched the Java compiler for the main project from JavaSE-1.7 to JavaSE-1.6. Now know why this is not with JavaSE-1.7. I would be grateful for any comments on this.

EDIT: linked mail: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=2314

+9
source

In my case, this was due to my main Game class derived from the framework Game class. The frame class was not correctly included; since the subclass was not found, Android reported that the main class could not be found (since it was not completely known).

To solve this problem, I correctly added the original link to the structure, and everything worked.

0
source

In should have checked the switch in the properties of the Android project -> Java Build Path-> Order and Export-> main game project. Hope this helps anyone.

-1
source

All Articles