1

I can get the my-gdx-game-desktop java application running no problems but can't seem to get my-gdx-game-android to work.

I receive the message 'unfortunately, my-gdx-game has stopped' on my AVD.

Logcat:

07-21 10:00:59.509: D/dalvikvm(791): Not late-enabling CheckJNI (already on)
07-21 10:01:00.289: D/dalvikvm(791): Trying to load lib /data/app-lib/com.mygdx.game.android-2/libgdx.so 0x416e54c0
07-21 10:01:00.310: D/dalvikvm(791): Added shared lib /data/app-lib/com.mygdx.game.android-2/libgdx.so 0x416e54c0
07-21 10:01:00.319: D/dalvikvm(791): No JNI_OnLoad found in /data/app-lib/com.mygdx.game.android-2/libgdx.so 0x416e54c0, skipping init
07-21 10:01:00.359: D/libEGL(791): Emulator without GPU support detected. Fallback to software renderer.
07-21 10:01:00.429: D/libEGL(791): loaded /system/lib/egl/libGLES_android.so
07-21 10:01:00.489: D/AndroidRuntime(791): Shutting down VM
07-21 10:01:00.509: W/dalvikvm(791): threadid=1: thread exiting with uncaught exception 
(group=0x41465700)
07-21 10:01:00.539: E/AndroidRuntime(791): FATAL EXCEPTION: main
07-21 10:01:00.539: E/AndroidRuntime(791): java.lang.RuntimeException: Unable to start 
activity ComponentInfo{com.mygdx.game.android/com.mygdx.game.android.AndroidLauncher}: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-21 10:01:00.539: E/AndroidRuntime(791):  at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.os.Looper.loop(Looper.java:137)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.ActivityThread.main(ActivityThread.java:5103)
07-21 10:01:00.539: E/AndroidRuntime(791):  at java.lang.reflect.Method.invokeNative(Native Method)
07-21 10:01:00.539: E/AndroidRuntime(791):  at 
java.lang.reflect.Method.invoke(Method.java:525)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-21 10:01:00.539: E/AndroidRuntime(791):  at dalvik.system.NativeStart.main(Native Method)
07-21 10:01:00.539: E/AndroidRuntime(791): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.badlogic.gdx.backends.android.AndroidGraphics.createGLSurfaceView(AndroidGraphics.java:121)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:101)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:94)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.badlogic.gdx.backends.android.AndroidApplication.init(AndroidApplication.java:130)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.badlogic.gdx.backends.android.AndroidApplication.initialize(AndroidApplication.java:96)
07-21 10:01:00.539: E/AndroidRuntime(791):  at com.mygdx.game.android.AndroidLauncher.onCreate(AndroidLauncher.java:14)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.Activity.performCreate(Activity.java:5133)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-21 10:01:00.539: E/AndroidRuntime(791):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
07-21 10:01:00.539: E/AndroidRuntime(791):  ... 11 more

Sorry if this is a stupid question and I'm doing something incredibly dumb. As you can probably tell I'm new to coding so any help is appreciated!

P.T.
  • 24,557
  • 7
  • 64
  • 95
user3355817
  • 121
  • 1
  • 1
  • 6
  • What level of Android are you using, SDK-wise? Anything below API Level 8 is no longer supported, because the new libGDX requires OpenGL ES 2.0. – EpicPandaForce Jul 21 '14 at 14:16
  • Please check if your Android-Manifest.xml has the following line, and if not, then add it and try again: `` – EpicPandaForce Jul 21 '14 at 14:17
  • I'm using API 19 so I don't think thats the issue. Adding that line to the manifest didn't do anything either. Going to reinstall libgdx and gradle from scratch. Maybe there was a problem with the install process. – user3355817 Jul 21 '14 at 14:30
  • Hmm that is really odd. I guess that could work, yes. This "Gradle" thing is good in concept but it causes a whole bunch of issues... are you using Gradle 2.0 or 1.12? – EpicPandaForce Jul 21 '14 at 14:36
  • 3
    WAIT A SECOND. What are you trying to run it on? Actual device, or emulator? Default emulator or GenyMotion? The default emulator does not support OpenGL ES 2.0. – EpicPandaForce Jul 21 '14 at 14:52

2 Answers2

1

It seems like there is a bug with the Android API 19 emulator. If I run a libgdx OpenGL ES 2.0 app in API-19 I get the same exception:

E/AndroidRuntime(791): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: 
Libgdx requires OpenGL ES 2.0

The workaround is to use another emulator with an a little bit lower API level that still has OpenGL ES 2.0, but doesn't have this annoying bug. A good choice for testing would be the Galaxy Nexus Emulator with API 17 for example. For me the same libgdx OpenGL ES 2.0 app worked fine there. You should give this a try.

donfuxx
  • 11,277
  • 6
  • 44
  • 76
0

07-21 10:01:00.359: D/libEGL(791): Emulator without GPU support detected. Fallback to software renderer.

It's neccessary to switch on "Emulator options: Use Host GPU"

mikowiec
  • 481
  • 7
  • 6