Reputation: 14426
I am trying to get into android development, after some reading i have settled on libgdx as the engine i will use.
I have got all the tools installed so i go to the wiki and find a Hello world tutorial!
http://code.google.com/p/libgdx/wiki/HelloWorld
I then download the zip and run gdx-helloworld it works! - GREAT.
So i then decide to see if it runs on my phone (Galaxy note, custom rom, android 2.3.6)... run gdx-helloworld-android it gets onto the phone but instantly crashes. Is this to be expected or have i done something wrong?
Many thanks.
The error i am getting is: 04-02 08:09:08.355: E/dalvikvm(14148): Could not find class 'com.badlogic.gdx.helloworld.HelloWorld', referenced from method com.badlogic.gdx.HelloWorldAndroid.onCreate
I went looking for this class and it seems to be in the correct place. I am new to eclipse and there is no squiggly underlines telling me what wrong so i am a little lost :)
I have also noticed that the gdx-helloworld project has a small exclamation mark on it.
Tried it again quickly last night, the exclamation was that it was referencing the JRE 1.6 library and i had the 1.7, so i fixed that, but it still did not run without crashing. I also tried on the emulator 2.3.3 and it crashed on that too.
Upvotes: 1
Views: 3325
Reputation: 14426
Fixed it, looks like adt 1.7 breaks it.
See the simple fix here: http://www.badlogicgames.com/wordpress/?p=2362
Some kind folks on the forums informed me that the latest Android ADT plugin breaks libgdx projects. The reason for this is that an Android Eclipse project no longer adds the sources of referenced Java projects to the APK it compiles. Why they had to do this is beyond me, the fix is simple however.
Click on your Android Project Select Properties Select Java Build Path Select Order and Export Check all your references, e.g. the gdx.jar, the gdx-backend-android.jar, your main code project etc. That’s it. Here’s a before and after image for a project that uses the jars.
Posted on March 22, 2012, 5:24 pm, by Mario
Upvotes: 3