On Android (specifically Kindle HD) the OpenGL surface becomes not valid in certain scenarios and the following error occurs:
11-16 16:32:06.991: E/GLSurfaceView(6652): eglCreateWindowSurface
11-16 16:32:06.991: E/GLSurfaceView(6652): java.lang.IllegalArgumentException: Make sure the SurfaceView or associated SurfaceHolder has a valid Surface
11-16 16:32:06.991: E/GLSurfaceView(6652): at com.google.android.gles_jni.EGLImpl._eglCreateWindowSurface(Native Method)
11-16 16:32:06.991: E/GLSurfaceView(6652): at com.google.android.gles_jni.EGLImpl.eglCreateWindowSurface(EGLImpl.java:90)
11-16 16:32:06.991: E/GLSurfaceView(6652): at android.opengl.GLSurfaceView$DefaultWindowSurfaceFactory.createWindowSurface(GLSurfaceView.java:798)
11-16 16:32:06.991: E/GLSurfaceView(6652): at android.opengl.GLSurfaceView$EglHelper.createSurface(GLSurfaceView.java:1065)
11-16 16:32:06.991: E/GLSurfaceView(6652): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1433)
11-16 16:32:06.991: E/GLSurfaceView(6652): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
I am facing this exact issue with the same exception and call stack. Have you implemented the solution you found on the stackoverflow link? If yes, did it work for you?
Sorry, I never seem to get notified when new messages come in.
I ended up removing the feature because I didn’t have time to deal with it.
I was using v2.2.1 and I was basically launching an AdMob interstitial ad onResume(). I think launching any activity while the GL surface is still initializing can cause this problem.
I have implemented google play services to our game. If the user does not have a google account signed in, google play services will switch to the standard google signin/signup menu. In the background the game crashes with the same call stack.
I am using cocos2d-x 2.2.5. We have seen the crash on Android 4.1.2, 4.2.2, 4.4