libgdx : running as an Android Project is not working

Hi,

I’m trying to run my LibGDX project within Eclipse as an android project, but I can’t get it to work.
My game works fine when i run it with the desktop launcher & there seem to be no errors in my android project, but it won’t work.

I got no experience with using the Android project & so no clue where to start solving this issue.
Any bit of help would be greatly appreciated.

This is what my Eclipse LogCat output looks like:

You might want to copy the text of your error so we can actually read it.

You also might want to provide an MCVE that demonstrates the problem. Note that this shouldn’t be your whole project, just enough code that we can copy and paste it to see your error.

If you scroll the image to the right side, the text of the logCat should be fully readable.
*if it’s other text you need to read pls let me know

As with the code I dont really see which piece of code i should give you that could be of any help.
Project is running fine in desktop, just doesnt wanna start as an Android application.
It’s a standard libGDX project build and I havent changed anything in the android launcher or the android project.
The code is extensive already. But if you tell me which code u need I’ll try to post it.

creating an MCVE is also a bit difficult i think. If the problems is caused by something that is computer specific like settings are set different, or installed software or whatever then trying to run the project as an android apllication might work on your computer but not on mine…

I’m not sure whether this will help you, but you can try the following:

  • Goto AndroidLauncher
  • in the configuration, set .useGLSurfaceView20API18 to true

No idea if this will help, but something is better than nothing I guess! :smiley:

Are you using a smartphone or the virtual machine? What is your phone model? The log says something about an error trying to initialice gles2. In your desktop it works because it uses OpenGL 3+ (unless your computer is very old).

Your device may not be capable of running gles2 and because gles2 is a subset of OpenGL2 it works on your desktop and not on yor phone.

Check your phone, tell us the model so we cant work on a solution. Try trollwarrior1 suggestion too.

Edited cuz I wrote the reply in Spanish instead of English: :clue:
Lo estás ejecutando en un móvil o en la máquina virtual? Qué móvil es? Por lo que dice ahí está fallando el iniciar gles 2. Por eso te funciona en el escritorio, ya que ahí se usa OpengGL 3+ que es una versión superior (a menos que tu ordenador sea muy viejo).

OGLES 2 es por decirlo así un subconjunto de OGL 2.

I’ve set .useGLSurfaceView20API18 to true like u suggested , but that wasnt enough…

I’m now using my smartphone, since i also have a problem of gradle not being able to package my project and thus i cant test it on my device (i also created a topic for that: http://www.java-gaming.org/topics/libgdx-anroid-can-t-get-my-project-packed-to-an-apk-file/34034/view.html).

  • i got an LG-L70 btw…

So now I created a new virtual device and this time it seems to get passed the “libgdx requires openGL 2.0” error, although it still won’t work.
The virtual device also seems to be having trouble with the sound input

Here’s what the logcat’s displaying now
http://pastebin.java-gaming.org/cbd410053071b

Can you at least read the error yourself before commenting? It says that the crash was caused by libgdx failing to load sound called “level1.ogg”

well sry… i thought that failing to load the sound file is one amongst more problems that keeps the AVD from running properly.

So my audio files are in fact placed in the assets folder of my android project under assets/music/
When i run my project using the desktop launcher the music for the different levels work just fine.

*Then it doesnt make much sense to me why my virtual device gives a runTimeException error?

I had a similar problem once, but the solution was pretty simple in my case. Try renaming your level1.ogg file to level1.OGG with uppercase letters in the fileending. I have no idea why it is like this, but it worked in my case, might work for you too

Tried your suggestion, but it’s not working…