Android Exception eglSwapBuffers failed: EGL_BAD_ALLOC

Hello community !

We have launched an Android game made with Unity on the Android Market and got some errors in our report manager, and one in particular that is :
java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1099)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1057)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1389)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1138)

Does anybody know where it comes from ?

Thanks !

I’m getting the same thing:

java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1077)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1035)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1333)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)

I’m getting the same error.

According to the internets, it is caused by not calling GLSurfaceView.OnPause(), or by not using the Cupcake GLSurfaceView for all Android versions if GLES 1.x is requested.

http://stackoverflow.com/questions/6039107/android-glsurfaceview-egl-bad-alloc
http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=1418&start=50

These seem to be internal to the Unity Engine (as far as I can tell).

Got it too:

java.lang.RuntimeException: eglSwapBuffers failed: EGL_BAD_ALLOC
at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1178)
at android.opengl.GLSurfaceView$EglHelper.swap(GLSurfaceView.java:1136)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)