Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.RuntimeException: eglSwapBuffers failed: EGL_SUCCESS report

I have android game, using libgdx framework

on Google Play store there are report:

java.lang.RuntimeException: eglSwapBuffers failed: EGL_SUCCESS
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1085)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1043)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1369)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1123)

what I can do?

devices reported : Samsung GT-S5830i, Samsung galaxy Y, LGE LG-P990 , Motorola Photon 4G, Motorola Droid X2,

like image 519
Bera Avatar asked Jun 03 '12 14:06

Bera


2 Answers

This problem has been reported here before. There is already an issue filed.

You can help by providing more details to this issue.

like image 133
Stefan Hanke Avatar answered Nov 15 '22 09:11

Stefan Hanke


I made some research and found out that this problem occurs in low end devices because they have low memory. Loading and unloading of textures between two scene crashes SwapBuffer and hence throws this Runtime exception.

Most annoying thing about this issue is that, when I tested in such devices, I didn't get any such error but in playstore I got too many report with this issue.

So, we can tackle this issue in two ways:

1)Filter out low end devices from compatible list.

2)Catch the exception using UncaughtExceptionHandler() and tell user about low memory problem.

like image 32
Crawler Avatar answered Nov 15 '22 09:11

Crawler