Acknowledged

Watchface Crashes, but Sim and Preview are Working

Hi everyone,

I'm having an issue where my generated Watchface is crashing, but both SIM and the WatchfacePreview work like a charm.

Source Code (incl .prg) here:

https://github.com/r-neuschulz/HeartsDesire

Tested on Garmin Epix Pro 2 (Gen 2).

Steps to reproduce:

  1. Build the Project
  2. Load .prg file to Device
  3. Observe how the watchface defaults to a standard watchface, but the preview looks correct (like in the SIM).
  • This kind of question is a good one for the main Discussion forum (https://forums.garmin.com/developer/connect-iq/f/discussion) since it sounds like there's additional debugging and investigation you can do. An app crash is usually due to a bug in the code that you'll need to address, while a device crash is more often a problem with Connect IQ that Garmin needs to address.

    I'd recommend seeing if someone can try this on another device (some developers in the community may be willing to help you out here) and see if the same thing occurs. It could be something that only affects certain products or it could be a problem with your particular device. jim_m_58's suggestion of adding println() statements is a good one, and we also have a debugger that's part of the VS Code extension you could leverage to try to narrow down the source of the problem. That, or there's always commenting out bits of code you suspect until you have something that works. Slight smile

    If you can demonstrate the problem is not in your code and you believe you can make a case for a Connect IQ bug, provide that info here and we can take a look. Also, review https://forums.garmin.com/developer/connect-iq/w/wiki/5/bug-reports-faq to make sure you're providing the info we need to investigate.

  • That's good to know! And thanks for all the time you have already invested, Jim.

    Unfortunately, I still had no luck, even after a reboot. Something is broken, and I don't know what. Maybe I botched the getSensorHistory function in a way that only breaks when deployed as a Watchface and not in the preview? Will investigate that next.

  • It's not common, but there have been cases where something corrupts something else.  Try rebooting your watch.  Press and hold the upper left button for 15-20 seconds and the watch will turn itself off.  Then turn it back on.

  • Thanks for the link! (And for the hint to uninstall before new sideloading).

    I placed some strategic println calls, and my findings are:

    In the preview, it successfully goes from the constructor initialize() -> onLayout() -> onUpdate()
    However, once i start the watchface it finishes the constructor initialize(), but then nothing. From what I see, onUpdate() isn't even being called, it crashes before. Without CIQ_LOG.

    Interesting too: the analog watch indicator of the default watchface (provided by garmin) vanishes, after my app crashed. Weird.

  • If there is no ciq_log, what I'd do is start adding println calls and create a log file for your app on the device.  See https://forums.garmin.com/developer/connect-iq/w/wiki/4/new-developer-faq#debugging in the new developer FAQ.

    Note.  if you installed from the app store, uninstall that, before you copy a new sideload over.  When you install from the store, your prg is given a different name, and it's easier if you can just use the name you set.