eglSwapBuffers failed: EGL_BAD_NATIVE_WINDOW

I am developing game with cocos2dx-lua 3.16 version
my game is working as well in windows
so I built apk in android mode with this code and ran game in my phone
first, it works very well
but after 20 min, my game was stuck and got error message as follow

Maybe @zhangxm might know.

Thanks for your reply
I already sent error message to @zhangxm too
but he doesn’t reply yet
can you help me?

I am not sure if it is something with luajit. You can create an empty lua project to test if the issue still exists. If so, then you can use try latest luajit.

well, I am using lua file for android debug now
So I think it doesn’t problem luajit and it is glsurfaceview problem
what about your think?

Did you modify the any java codes? It should not have problem as many developers use it.

well, I changed nothing for java files

I already built and tested with luajit of cocos2dx3.17.1
but I got same error
please let me know solution

It is wired. Could you please provide these informations:

  • detail steps to reproduce the issue
  • the devices you tested on
  • can you reproduce it by lua-empty-test