Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I was searching for different ways that could suit me in programming and came across LibGDX. Naturally I looked at the tutorial. As I was doing it, I was following the steps word for word, except naming the classes. In the end, I was able to create the desktop launcher for the game but not the android launcher.

The following error is my error: Cannot instantiate the type Game (Game is the name of the class)

I got the tutorial from The link in the tutorial is the original but it uses jogl instead of lwjgl.

share|improve this question
up vote 1 down vote accepted

From the wiki:

Note: The folder really must be called "libs", a naming convention forced on us by the Android Eclipse plugin.

Without this, your code will still compile within Eclipse, because it is compiling against gdx.jar from the (referenced), desktop project, but won't run on an Android device because gdx.jar wasn't in the libs dir. Although I too have come across (and enjoyed) the tutorials you pointed to, it seems like this point was missed.

share|improve this answer
I think i know the problem but i dont know how to fix it, the code can be fixed if the name of the file is within the same project. I selected a build path from the Android one to the Desktop one. But it still wouldn't work. What did i do wrong? – Blue Mar 21 '12 at 14:13
The video linked to from the main google code page discusses this at 7mins 8 secs: – Peter Serwylo Mar 21 '12 at 22:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.