0

As I'm new to OpenGL programming, I have tried to test the sample code shown in the OpenGL2.0 tutorial. The application is compiled without error but when I try to run it in the emulator, it crashes. Below is what DDMS says :

01-08 08:03:41.365: E/AndroidRuntime(380): FATAL EXCEPTION: GLThread 8
01-08 08:03:41.365: E/AndroidRuntime(380): java.lang.IllegalArgumentException: No configs match configSpec
01-08 08:03:41.365: E/AndroidRuntime(380):  at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)
01-08 08:03:41.365: E/AndroidRuntime(380):  at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)
01-08 08:03:41.365: E/AndroidRuntime(380):  at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1246)
01-08 08:03:41.365: E/AndroidRuntime(380):  at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

Can anyone explain me the reason for the crash?

2
  • Can you share the line no this is originating from, in the tutorial? Commented Jan 8, 2012 at 8:30
  • My problem is that I can't localize the line from which the crash originates. I have stepped into the entire application and the crash appears when I exit the "onResume" function of the "Activity". Commented Jan 8, 2012 at 9:16

2 Answers 2

3

Thats because the emulator does not support opengl es 2, it currently only supports opengl es 1. You will need an actual device to run your code.

Sign up to request clarification or add additional context in comments.

1 Comment

I have tried on an actual Galaxy S with Android 2.3.3 and the system refuses to install the application. OpenGL 2.0 is supposed to work since Android 2.2 API level 8.
1

I was having the same problem for the longest time. I almost gave up. Make sure that in the created surfaceview class you set the context client version before you set the renderer.

Based on the tutorial your constuctor for the calss should look like this:

public MyGLSurfaceView(Context context){
    super(context);
    // Create an OpenGL ES 2.0 context
    setEGLContextClientVersion(2);
    // Set the Renderer for drawing on the GLSurfaceView
    setRenderer(new MyRenderer());
    // Render the view only when there is a change in the drawing data
    setRenderMode(GLSurfaceView.RENDERMODE_WHEN_DIRTY);
}//..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.