Android - Can't create OpenGL window. eglChooseConfig error

I’m currently working on a game for Android with SDL 2.0, and have swapped over to using OpenGL ES 2.0 for rendering. However, even the most basic code will fail to run, and the one error I get in LogCat is in response to the window creation, and the error is "02-19 16:28:11.486: E/SDL(4537): Failed loading eglChooseConfig: Invalid library handle: ". I did a quick scan of the SDLActivity.java file, and found no reference to EGL or OpenGL ES. I’m assuming the version of the API that I have is intended to do everything related to setting up EGL in native code because of this, but that doesn’t seem very likely.

Which device are you using and which android version? There is a known
problem about the wrong pixel format being chosen (332) - maybe it’s
related (please specify what “fail to run” means.Am 19.02.2014 23:33, schrieb rocko384:

I’m currently working on a game for Android with SDL 2.0, and have
swapped over to using OpenGL ES 2.0 for rendering. However, even the
most basic code will fail to run, and the one error I get in LogCat is
in response to the window creation, and the error is "02-19
16:28:11.486: E/SDL(4537): Failed loading eglChooseConfig: Invalid
library handle: ". I did a quick scan of the SDLActivity.java file,
and found no reference to EGL or OpenGL ES. I’m assuming the version
of the API that I have is intended to do everything related to setting
up EGL in native code because of this, but that doesn’t seem very likely.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

rgb:332 is the default pixel format SDL, which is used when the user does
not specify something better. On desktop platforms, the format matching
logic will usually pick something more reasonable.

Have you tried specifying a different format via SDL_GL_SetAttribute()?
Something like rgb:565 or rgb:888 ought to work.

2014-02-20 10:01 GMT+01:00 Martin Gerhardy <martin.gerhardy at gmail.com>:> Am 19.02.2014 23:33, schrieb rocko384:

I’m currently working on a game for Android with SDL 2.0, and have swapped
over to using OpenGL ES 2.0 for rendering. However, even the most basic
code will fail to run, and the one error I get in LogCat is in response to
the window creation, and the error is "02-19 16:28:11.486: E/SDL(4537):
Failed loading eglChooseConfig: Invalid library handle: ". I did a quick
scan of the SDLActivity.java file, and found no reference to EGL or OpenGL
ES. I’m assuming the version of the API that I have is intended to do
everything related to setting up EGL in native code because of this, but
that doesn’t seem very likely.


SDL mailing listSDL at lists.libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Which device are you using and which android version? There is a known
problem about the wrong pixel format being chosen (332) - maybe it’s
related (please specify what “fail to run” means.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

2014-02-19 19:33 GMT-03:00 rocko384 :

I’m currently working on a game for Android with SDL 2.0, and have
swapped over to using OpenGL ES 2.0 for rendering. However, even the most
basic code will fail to run, and the one error I get in LogCat is in
response to the window creation, and the error is "02-19 16:28:11.486:
E/SDL(4537): Failed loading eglChooseConfig: Invalid library handle: ". I
did a quick scan of the SDLActivity.java file, and found no reference to
EGL or OpenGL ES. I’m assuming the version of the API that I have is
intended to do everything related to setting up EGL in native code because
of this, but that doesn’t seem very likely.

This means SDL failed to load libEGL.so, what Android version and device
are you using? Can you shell into the device and see if you can spot the
library? Any other errors in the log? (Before the one you posted)–
Gabriel.

I’ve been testing on both my phone, which is running Android 4.1.1, and an emulator, which is running Android 4.4.2. By failing to run, I mean that the context creation complains about an improper window, and isn’t created. On the physical device and emulator, the color format defaults to RGB_565. The error I get from the emulator is slightly different. “02-20 16:25:10.273: E/SDL(1077): Failed loading eglChooseConfig: dlsym library handle is null”. Both libraries exist on my phone, so that isn’t the issue.

2014-02-20 18:51 GMT-03:00 rocko384 :

I’ve been testing on both my phone, which is running Android 4.1.1, and
an emulator, which is running Android 4.4.2. By failing to run, I mean that
the context creation complains about an improper window, and isn’t created.
On the physical device and emulator, the color format defaults to RGB_565.
The error I get from the emulator is slightly different. “02-20
16:25:10.273: E/SDL(1077): Failed loading eglChooseConfig: dlsym library
handle is null”. Both libraries exist on my phone, so that isn’t the issue.

Have you tried building using build-scripts/androidbuild.sh? What about one
of SDL’s tests (testgles2.c for example)?–
Gabriel.

I just tested “testgles2.c” with identical build scripts, and it worked flawlessly. Sorry if the problem is painfully obvious. I’m not used to using a system that forces native code to interface with an abstraction layer written in Java.