- Home /
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 !
Answer by normantran86 · Dec 07, 2011 at 09:58 AM
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)
Answer by soulburner · Feb 13, 2013 at 07:56 PM
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)
Answer by cowlinator · May 07, 2013 at 06:37 PM
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☆t=50
These seem to be internal to the Unity Engine (as far as I can tell).