[Solved] My app keeps crashing and there are no debug logs, how can I found out what's going wrong? It works fine on the emulator.

I've tried installing the development build and the production build, both of them crash after an arbitrary amount of time using the app, but when I go to check the logs in "GARMIN/APPS/LOGS" there is only a single file last modified 8 months ago from a completely different app.

When I run it in the emulator it runs fine. I've checked the memory usage and it's consistently well below the maximum, and there doesn't seem to be any kind of memory leak.

How do I go about debugging this on my garmin device.

Context:
The app is a tennis score tracker, it's very simple with only 5 views.
I am testing it on a Vivoactive 4
- SW Version: 7.8
- API Level 3.3.6
I cannot test an emulator with that API level (it required 4.0.2 minimum) and I cannot find out how to upgrade my watch API level, it is an old watch, so that could be part of the problem.

  • I cannot test an emulator with that API level (it required 4.0.2 minimum) and I cannot find out how to upgrade my watch API level, it is an old watch, so that could be part of the problem.

    The va4 doesn't support CIQ 4.x  Only newer watches do.

    It's a CIQ 3.x device.  You want to set the minApiLevel for your app in the manifest.xml to be something like 3.3.0

  • The minApiLevel is set to 3.2.0 and I have downloaded SDK 3.2.5, but when I set that as my SDK and try to run the emulator it says "The current SDK must be set to 4.0.6 or newer.

  • The current SDK is 6.2.1.  You can use that to build for the va4 or any CIQ device.  The SDK level does not need to match the API version on a device.  Try with the 6.2.1 SDK.

  • I have tried all of them. The App that is currently on the watch was built with SDK 6.2.1 and it still crashed with no logs.

  • Do you see an "IQ!" or does the app just terminate?

  • The app just terminates. It's also inconsistent. It happens when I press touch the screen to mark a point won, but it's random when it happens and which button is tapped.

  • In your input delegate, make sure you always return true; or return false; for everything like onTap(). onKey, etc.

    True means you handled something, while false mains you didn't and the system does the default.

    You didn't crash as without the true/false, your app is terminating on some input.

  • Thank you, I've figured it out.

    The delegate was returning true for every event that it handled, but I am using an xml drawable to draw the layout and there are events for all the buttons, but no events for the lines!!!

    That's why it seemed inconsostent and why I couldn't reproduce it on the emulator, my fingers are a lot less accurate than the mouse and sometimes I was missing the button and tapping the lines in between, as there was no handler for those elements, it must be doing what you said.

    Thank you very much for your help, this has had me stumped for so long.