Android AndEngine问题:java.lang.IllegalArgumentException:找不到EGLConfig

时间:2012-09-05 13:44:28

标签: java android andengine

晚上好!

我一直在使用AndEngine修补Android中的游戏开发。我尝试运行使用AndEngine的Tower of Hanoi游戏应用程序,但是当我在模拟器中运行它时,前面提到的错误仍在运行。这是LogCat:

09-05 21:34:00.948: D/dalvikvm(633): No JNI_OnLoad found in   /data/data/com.tutorial.towerofhanoi/lib/libandengine.so 0x4101f730, skipping init
09-05 21:34:01.017: D/AndEngine(633): TowerOfHanoiActivity.onResume @(Thread: 'main')
09-05 21:34:01.067: I/dalvikvm(633): threadid=3: reacting to signal 3
09-05 21:34:01.137: I/dalvikvm(633): Wrote stack traces to '/data/anr/traces.txt'
09-05 21:34:01.207: D/libEGL(633): Emulator without GPU support detected. Fallback to software renderer.
09-05 21:34:01.207: D/libEGL(633): loaded /system/lib/egl/libGLES_android.so
09-05 21:34:01.238: W/dalvikvm(633): threadid=12: thread exiting with uncaught exception (group=0x409c01f8)
09-05 21:34:01.297: E/AndroidRuntime(633): FATAL EXCEPTION: GLThread 85
09-05 21:34:01.297: E/AndroidRuntime(633): java.lang.IllegalArgumentException: No EGLConfig found!
09-05 21:34:01.297: E/AndroidRuntime(633):  at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:183)
09-05 21:34:01.297: E/AndroidRuntime(633):  at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:157)
09-05 21:34:01.297: E/AndroidRuntime(633):  at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1009)
09-05 21:34:01.297: E/AndroidRuntime(633):  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1362)
09-05 21:34:01.297: E/AndroidRuntime(633):  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
09-05 21:34:01.309: D/gralloc_goldfish(633): Emulator without GPU emulation detected.
09-05 21:34:01.497: D/AndEngine(633): TowerOfHanoiActivity.onPause @(Thread: 'main')
09-05 21:34:03.867: I/Process(633): Sending signal. PID: 633 SIG: 9

受错误影响的代码行位于AndEngine库本身,特别是这一行:

            throw new IllegalArgumentException("No " + EGLConfig.class.getSimpleName() + " found!");

屏幕截图显示了我正在构建的目标。这是API15 Android 4.0.3

enter image description here

我该如何解决这个问题?

3 个答案:

答案 0 :(得分:3)

我认为问题在于这一行

09-05 21:34:01.207: D/libEGL(633): Emulator without GPU support detected. Fallback to software renderer.

重新创建或编辑您的模拟器,并确保在您拥有的硬件列表

GPU Emulation设置为Yes

答案 1 :(得分:0)

我有这样的问题。 我的解决方案(需要编辑AVD):

  1. 启用“使用主机GPU”
  2. 我将CPU / ABI更改为“Intel Atom(x86)”
  3. 我将Target从API级别17更改为API级别15(Android 4.0.3)
  4. 它有效!!!

答案 2 :(得分:0)

您需要启用模拟器GPU。

要在Eclipse中执行此操作,请转到Window> AVD Manager选择您的AVD并单击“编辑...”,选中“使用主机GPU”框,然后保存并重新启动AVD。