3

The log says

 java.lang.RuntimeException: createContext failed: EGL_SUCCESS
        at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1193)
        at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1184)
        at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1034)
        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

when I try to use the Rajawali library on Android studio. I found out that the problem must be device-capability-specific, because my app runs on other devices (Samsung Galaxy Tab 4, Nexus) but not on Sony Xperia LT30p. I have looked around and have only found this thread talking about the same problem. I thought it might be a problem of RAM or overflowing, so I disabled all background processes and uninstalled most apps. Still, the error persists. Does anyone know why this happens and if there exists a way around it?

Kantharis
  • 1,316
  • 1
  • 11
  • 21

1 Answers1

2

Maybe because the config call order is wrong..

    setEGLConfigChooser(8, 8, 8, 8, 16, 0);
    setEGLContextClientVersion(2);
    getHolder().setFormat(PixelFormat.TRANSLUCENT);

And the right order is:

    setEGLContextClientVersion(2);
    setEGLConfigChooser(8, 8, 8, 8, 16, 0);
    getHolder().setFormat(PixelFormat.TRANSLUCENT);

But even using wrong order, the code is still correct in most of the phones.(I just met this error at a 4.2.1 phone)

ChillingVan
  • 131
  • 6
  • The GLSurfaceView docs don't specify a correct call order for those two methods as far as I can tell - do you have a link to back up this answer? – Karu May 12 '17 at 03:18
  • @Karu No, I just tried it by myself and found the issue on the specific phone. So I do not know why. – ChillingVan Jun 19 '17 at 06:39