Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Android crash from onDrawFrame — Gideros Forum

Android crash from onDrawFrame

The Google Play console is showing a number of crashes in the nativeDrawFrame function in my new game. I've eliminated all crashes I've seen within the lua itself, but I'm at a loss about solving this one. It's happening to a small percentage of users, but enough to get the game flagged for "bad behavior" in the store. The app is build with Gideros 2025.10. Any ideas where to start? Here's the stack that GP shows:

Exception com.giderosmobile.android.player.LuaException:
at com.giderosmobile.android.player.GiderosApplication.throwLuaException (GiderosApplication.java:1702)
at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame
at com.giderosmobile.android.player.GiderosApplication.onDrawFrame (GiderosApplication.java:832)
at com.giderosmobile.android.GiderosRenderer.onDrawFrame (ifd2Activity.java:518)
at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1589)
at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1288)

Comments

  • hgy29hgy29 Maintainer
    This is actually a lua exception which turned into a java exception by Gideros since the app isn’t a player. If we had the associated logcat log, we could have seen the usual lua stack trace.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
  • PaulHPaulH Member
    I'm at a loss how to hunt this down. I'm unable to reproduce it and I have no idea what's going on when it happens. Other lua errors have appeared with the call stack in the Play console, and I have a lot of the complicated stuff pcall protected and reporting would-be crashes to my server, but I'm not seeing anything like that. If I had a specific user encountering it I can give them a tech support code that would enable pcall protection for lots more, per-frame stuff I don't otherwise pcall for performance reasons. Any advice on tracking something like this down?
  • hgy29hgy29 Maintainer
    I have often seen lua crashes without stack trace when the crash occur in a coroutine or in a Gideros asyncCall, sych as in:
    local function crash()
    	z()
    	x=x+1
    end
     
    Core.asyncCall(function() crash() end)
    All I get with this code is:
    main.lua:2: attempt to call a nil value
    While I expected a full stack trace.
    But in your case of a crash reported by GooglePlay doesn't even include the lua error message itself, which is quite surprising. I can certainly fix Gideros code so that it computes a stack trace even for coroutines, and I'll try to reproduce the lack of lua error message in the java exception.
  • hgy29hgy29 Maintainer
    About the lua crash message missing, it seems to be a google play bug (or feature): https://www.reddit.com/r/androiddev/comments/6ihcr7/exception_messages_missing_in_new_play_console/
  • PaulHPaulH Member
    Interesting. Juist knowing it may be coming from within an asyncCall narrows things down considerably. Thanks for the info. I use asyncCall just for loading things, building models, etc., before the main loop. I'm going to get those all in xpcalls, sending me (hopefully) a stack trace or at least the basic error message and line number.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.