Debugging Crash only happening when loaded from store

I updated my App to fix a minor bug, but had to switch the SDK and development environment from eclipse to vs code.

The new version with to current sdk 6.2.1 runs in simualtor and on device (Fenix 6X Pro), also with release configuration.
I tested it for one week without any problems before uplaoding it to the store yesterday.

When it was updated on the watch from the store, it crashed when starting a recording. Deinstalling from watch and reinstalling fixed it. at least I thought.
Because when I change any setting of using the smartphone-App or even don't change anything but save the settings, the App chashes.

When setting the settings in simulator, everything works fine.

My Problem is, I don't know how to debug because there is no logfile with stacktrace on the watch and I cannot reproduce it with the simulator. And for the "Build for Device Version" I cannot change the settings using the phone-App - or can I?

There were some warnings about deprecated functions (Application.getApp().getProperty() was used) I changed everything to the newer Functions and there are no warnings anymore, but the behaviour on the watch remains.

Does anyone have a hint for me?

Thanks in Advance!

  • This seems to be the old known Garmin Connect issue when numeric settings are being interpreted as strings. This problem along with a workaround is mentioned in the official Connect IQ developer FAQ:

    forums.garmin.com/.../new-developer-faq

  • The code you linked to with readKeyInt() is actually something I posted here 7-8 years back.

    I still use it in every single app that uses app-settings, but it's changed a bit where on devices with Application,Properties, it uses that, along with the try/catch in the event of a bad key.

    A simple wrapper function can prevent some headaches!

  • Thanks' for your reply.
    I used this function for the int values now, and what I already did yesterday was surrounding all read/write properties calls wit htry..catch.

    But it didn't change anything.

    When I delete the .SET file from the watch, the App runs. When calling settings from Phone it doesn't run. So I compared the .SET files created by the App on the Watch with that one created on the watch by using the Phone app. The latter is bigger and it looks like it would conatain an Option named "false", but the binary format is hard to undestand without documentation.

    https://ibb.co/wrqM71k (third row: false)

    The Settings are read by my app just after starting the App, the crash happens later when starting activity recording. I try to figure out what settings are read then, that also come from the phone App by this .SET File. I thought of getting userProfile Data, added try..catch clauses as well but it still crashes.

  • When you change settings for a running app, you'll see a rise in peak memory.  In the sim, you can see this with "view memory".  How close to the max memory for the app does peak get?  This happens even if you don't read the new settings.

  • it does not increase the peak Memory in this case. And Peak Memory is 108kB only of 1275kB, thus I think that is not the Problem.

  • And there is nothing in the ciq_log file?  When this happens, do you see the "IQ!" icon, or does your app just terminate?  Which device?  In your input delegate, do you always return true of false from the callbacks (onKey,onSelect, etc)?

  • Can you show us your properties.xml, settings.xml and the code with try/catch you use to read the settings?

  • I noticed that the Connect App on Phone still showed an old version Number even if I installed a newer one using that app.
    However after restarting that App it remained, but not after rebooting the phone.

    Now I cannot reproduce the Problem. Don't know if it is related to that app behaviour..

    Now the .SET File written after configuration using the Phone looks the same, as when created by the App on the watch without changing Settings on the Phone.

    My conclusion is: the .SET File was corrupted when using the Phone App, probably because some information stored on the Phone was wrong.
    What do you think?

  • When you do app settings, the current settings are pulled from the device, and the info to use them is pulled from the app store.  This is why you can't do settings with a sideload.  Nothing is cached on the phone.

    Again, are you crashing (seeing IQ!) or terminating?  Some devices are really picky about having the proper return true/false in the delegate, and you won't see that in the sim.