3

a colleague of mine is working on a legacy ReactNative app. There is quite a lot of code both in JavaScript and Java land, the latter being related to HERE Maps SDK.

Two of our clients experience multiple crashes every day and we cannot figure out why as we have no error reports. Bugsnag was installed early last year (circa jan 2020) and we have nothing on there to help us. Nothing to be found in Google Console either. App just stops.

To help us debug we've added a logging system which sends debug info to our backend via dedicated API calls. It roughly consists of logging "start of function A", "end of function A" etc so we know what the app is doing. We don't always enable it as it tends to make the app even more unstable.

In parallel to that we managed to get an idea of when the app crashes via login events that are sent by Firebase Auth when user re-launches the app. Looking at our logs around the time of crash doesn't help us as 1) they look the same as when it all works and 2) we haven't covered all method calls as there are way too many (in JS and Java).

Our users run the app on a Samsung Galaxy Active Tab 2 mounted in the cabin of a tractor. Some use a Galaxy Active Tab 3 and also have the issue.

We have run through various theories :

  • Could it be too hot in the cabin so Android shuts down? No, tablet is always on according to clients.

  • Could it be related to a change in voltage? When WE try to plug and unplug everything continues to work fine.

  • Could it be Android that decides the app is consuming too much battery or CPU (GPS is needed for our app) so it shuts it down? We've let our app in the foreground for hours with no problem.

We logged in with customers' credentials (they are aware) and could not replicate the issue.

Customers interest in helping us find the issue is slowly fading away so we can't keep on asking them to install a patched version every week.

First there was just one client but now we have at least 3 more users complaining about mysterious crashes.

We're a bit stomped as to what to do.

Has anyone any idea of an ultimate catch all library? Or a syslog on the tablet where we could get more info?

Thanks in advance for your help!

Jools
  • 41
  • 6

2 Answers2

1

After much testing my colleagues managed to easily reproduce the error and found the root cause: poor memory management in one method in Java land. Said method was responsible for changing markers orientation on the map but it duplicated markers when their orientation changed. It resulted in a high memory consumption and when it reached a certain point Android would just kill all running apps.

My colleague fixed the leak and we're good! Onto the next bug now. :)

Jools
  • 41
  • 6
0

The below reasoning is based on hardware failure. If your software hasn't drastically changed (the app or the operating system), then this is a likely scenario:

The Tab 2 was released in 2012, so we're talking about a device that is up to 9 years old. If the users all use the same hardware, and the software hasn't been changed for a while, it could be some kind of hardware failure. It could be related to the vibrations of the tractor, moisture over time, or just because they used the tablet more intensively than you use yours. There could be something (semi-)loose or the memory (SSD or RAM) could start becoming faulty.

It can be a software error too of course, but it's unlikely if you haven't updated in a long time - assuming the tablets haven't been updated either.

Could you perhaps swap your tablet with one of a customer. Preferrably a customer that has the issue most often. Then observe if the issue is resolved. This way, you'll be able figure out if it is related to the tablet (being broken) or the environment (tractor) it is being used in.

If the issue persists after a tablet swap, it's either the environment or the software, but you'd have ruled out the hardware. If the issue is resolved, you'll know for sure it's the hardware at fault.

ByteWelder
  • 5,464
  • 1
  • 38
  • 45
  • Hi, thanks for your answer. I'll update my question cos our customers use an Active Tab 2 (released in 2017) and have the same issue on an Active Tab 3 that we sent them hoping it will work better... to now avail. We have tested the same app on both Active Tab 2 and 3 tablets and could not reproduce crashes they experiment. You're probably right about environment factors and them using the app more intensively. However, how can we get more info about the app being shutdown/killed silently? Is there a syslog of sort on Android? Thanks! – Jools Jul 15 '21 at 08:12
  • 1
    There's logcat... If the customer experiences a crash, and they can connect the device (in a timely fashion) to a laptop/desktop computer, they can use the `adb logcat` command from the Android toolchain to check what happened. – ByteWelder Jul 15 '21 at 17:40
  • Thanks for that. We’ll give it a try on Monday. – Jools Jul 16 '21 at 18:25
  • My colleague experienced two crashes today. She was recording her testing with AZ Recorder and both our app and AZ Recorder were shut down at the same time. She didn’t have other apps running so we can’t say Android terminates all running apps but what are the odds of two apps crashing at the same time? Surely it has to be some sort of clean up Android performed and just terminated whatever was running? – Jools Jul 16 '21 at 18:27