I'm using a service when the app is in the background (not Starter), that checks the GPS every couple of minutes or so. Once in a while this service crashes, and I get a message
TheApp has stopped
. This happens once or twice per 24 hours, roughly.
The first thing I do when the service wakes up is schedule the next run, and like a clock it restarts next time without problems or crashes. The service basically gets a GPS fix, chats with an external API and updates a notification - that's it.
Below is what the IDE logs when this happens. I should note that I'm running the app in Release mode, and am using the #BridgeLogger to get the logs.
Failed to create EGLSurface for window 0x7ba365e010, eglErr = EGL_BAD_ALLOC
--------- beginning of crash
Fatal signal 6 (SIGABRT), code -6 in tid 2106 (RenderThread), pid 2090 (the.app.name)
Neither the forum nor Google has a lot to say about this. There is a single hit in the forum for EGL_BAD_ALLOC, but that doesn't seem to relate to this issue. On the net, most hits about that error is related to React, and running the app in an emulator. I'm neither using React (duh), nor using an emulator. So I'm a bit lost here.
Does this error ring a bell for anyone?
Are you trying to create any views or show any dialogs in your service by any chance? EGL surfaces are related to UI stuff (
https://source.android.com/devices/graphics/arch-egl-opengl
) - & as you know, services don't have any visible elements & can't display dialogs (except toast messages).
- Colin.
You know, I actually saw that mentioned in one of the Google hits, so I went looking. I copied all code that is being run in the service and pasted it into a separate document and went through it with a microscope. I couldn't find anything at all. This sums up the service pretty well:
- GPS
- SQLite
- External API
- Notification
- Toast (for debugging)
- Timer
Not a single thing related to activities, views, dialogs or anything else that is UI-ish...
Not only Toastmessages but also Notifications are UI elements, even if not related to Activities, so it could also happen here.
Just to narrow-down the search, I'd comment out where the notifications are updated to see if results change.
I just realized I had a longer error message in another saved log file, perhaps that contains more clues? I'm seeing that backtrace line #05 mentions
Bridge_initialize
. Does anyone know if that is related to the B4A bridge or just some other bridgething in Android? Surely the problem couldn't be related to the B4A Bridge? (I am running the app in Release mode and use #BridgeLogger.)
I'll just go ahead and answer that one myself. No, not related to B4A Bridge. I tried
searching for android::uirenderer::renderthread::Bridge_initialize
and found this bug, which seems to be an exact match for me:
Real-time crashes, in abort, only in Android 8.1
https://issuetracker.google.com/issues/70259031
Apparently it's a bug related to Android 8.1, which is exactly what I'm using. So I suppose I'll just ignore this bug for now, and let Google sort it out to next OS update.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…