Java Eclipse:Android运行时错误

Java Eclipse:Android运行时错误,java,android,eclipse,android-emulator,runtime,Java,Android,Eclipse,Android Emulator,Runtime,我使用libgdx来设置我的项目,使用eclipseluna作为编辑器,使用avd进行仿真 我知道我有最新的安卓工作室 当我运行我的应用程序时,编译后我有这个。。。LogCat (ActivityThread.java:1981) 04-16 01:43:02.160: E/AndroidRuntime(620): at android.app.ActivityThread.access$600(ActivityThread.java:123) 04-16 01:43:02.160: E/An

我使用libgdx来设置我的项目,使用eclipseluna作为编辑器,使用avd进行仿真

我知道我有最新的安卓工作室

当我运行我的应用程序时,编译后我有这个。。。LogCat

(ActivityThread.java:1981)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.os.Handler.dispatchMessage(Handler.java:99)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.os.Looper.loop(Looper.java:137)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.app.ActivityThread.main(ActivityThread.java:4424)
04-16 01:43:02.160: E/AndroidRuntime(620):  at java.lang.reflect.Method.invokeNative(Native Method)
04-16 01:43:02.160: E/AndroidRuntime(620):  at java.lang.reflect.Method.invoke(Method.java:511)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-16 01:43:02.160: E/AndroidRuntime(620):  at dalvik.system.NativeStart.main(Native Method)
04-16 01:43:02.160: E/AndroidRuntime(620): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.badlogic.gdx.backends.android.AndroidGraphics.createGLSurfaceView(AndroidGraphics.java:127)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:107)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(AndroidGraphics.java:100)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.badlogic.gdx.backends.android.AndroidApplication.init(AndroidApplication.java:133)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.badlogic.gdx.backends.android.AndroidApplication.initialize(AndroidApplication.java:99)
04-16 01:43:02.160: E/AndroidRuntime(620):  at com.my.app.android.AndroidLauncher.onCreate(AndroidLauncher.java:14)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.app.Activity.performCreate(Activity.java:4465)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-16 01:43:02.160: E/AndroidRuntime(620):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-16 01:43:02.160: E/AndroidRuntime(620):  ... 11 more

看起来你的stacktrace中隐藏了一个根本原因:

Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0 04-16 01:43:02.160: E/AndroidRuntime(620):
  at com.badlogic.gdx.backends.android.AndroidGraphics.createGLSurfaceView(AndroidGraphics.java:127)

您应该确保用于测试的设备/模拟器支持OpenGL ES 2.0。

如果您不想共享导致此问题的代码,我们无法真正帮助您。。。提醒meUser的thx已经共享了详细信息/代码,所以让我们阻止它关闭问题!
package com.my.app.android;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.my.app.MyApp;

public class AndroidLauncher extends AndroidApplication {
    @Override
    protected void onCreate (Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
        initialize(new MyApp(), config);
    }
}
Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Libgdx requires OpenGL ES 2.0 04-16 01:43:02.160: E/AndroidRuntime(620):
  at com.badlogic.gdx.backends.android.AndroidGraphics.createGLSurfaceView(AndroidGraphics.java:127)