Watch face fails only after publishing to Connet IQ store

Former Member
Former Member
I have developed face that works on simulator and on real watch as well, however on real watch I have to set variables within the code as Setting is not available. The Setting works in simulator. When I publish to the app store and than download for testing, the app is given numbers instead of the name. I guess this is until the app is approved. When I download my app from the store, before the app is approved and public, the face goes blank after any change in setting.
In CIQ LOG.TXT I have
ERROR: Unhandled Exception
DETAILS: Failed invoking <symbol>
STORE_ID: fc0628f2c3ee4602b75eadd94832584c

Actually, to keep it simple, I just wrote a piece of code that reads the settings and displays them on the watch screen. It works fine within the simulator. If I publish to the app store and download to the watch, the app is renamed to a number but it works until I try to change any setting. Same error as above. I have to uninstall and re-install the app and it works again until I change any setting. I feel now that until the app is approved, it will have a number instead of a name and change of settings will not work. The only way to try is to wait until it goes public...unless someone has any better idea.
  • I have developed face that works on simulator and on real watch as well, however on real watch I have to set variables within the code as Setting is not available. The Setting works in simulator. When I publish to the app store and than download for testing, the app is given numbers instead of the name. I guess this is until the app is approved. When I download my app from the store, before the app is approved and public, the face goes blank after any change in setting.
    In CIQ LOG.TXT I have
    ERROR: Unhandled Exception
    DETAILS: Failed invoking <symbol>
    STORE_ID: fc0628f2c3ee4602b75eadd94832584c

    Actually, to keep it simple, I just wrote a piece of code that reads the settings and displays them on the watch screen. It works fine within the simulator. If I publish to the app store and download to the watch, the app is renamed to a number but it works until I try to change any setting. Same error as above. I have to uninstall and re-install the app and it works again until I change any setting. I feel now that until the app is approved, it will have a number instead of a name and change of settings will not work. The only way to try is to wait until it goes public...unless someone has any better idea.



    Can you please post some code here so we can have a look?

    It has nothing to do with being approved or not.
    Unapproved apps are working normally, the only difference being only the developer can download and test it.

    There is something else your code is not doing right, so sharing it will allow us to pinpoint your issue.
  • As Hermo said, posting your code would be very useful. You also may want to check the "New Developer FAQ2" sticky at the top of the forum, as that might give you the answer:

    https://forums.garmin.com/showthread.php?359183-New-Developer-FAQ-2

    It's got nothing to do with approval in the store, but likely how it works with GCM on your phone or GE.
  • Former Member
    Former Member over 8 years ago
    solved

    Even if you take a float number from an array, you still have to convert it to float otherwise the real watch will crash while the simulator will work fine.
  • Hey Pav.Ott,

    We'd like to take a little closer look as to why the watch itself was crashing. Could you email/pm with some more information about how it occurred? I'd like to know what platform you are using to change your settings: Android, iOS, or Garmin Express. Are you getting an app crash (IQ!) or is the watch crashing completely (have to restart)? What type of watch are you using? What software versions and SDKs are you using all around as well? Any info would be greatly appreciated in case there is a hidden bug there. Thanks again!

    Coleman
  • Coleman,

    If this is the same as the problem mentioned above, Float/Number values are being returned to the caller as the wrong type (String/Float). If you treat the result as if it were a Float/Number without explicitly converting it first, the framework will generate a type error. For example...

    var x = App.getApp().getProperty("float_val");
    if (x == null) {
    x = 1.0f;
    }

    // if the setting comes from Android, it sometimes comes back as a string, which causes this to explode.
    var y = 10 * x;


    The workaround it to ensure the result is the correct type before using it. It doesn't actually cause the device to crash, just the app (at least in all the cases that I've seen).

    Travis
  • Former Member
    Former Member over 8 years ago
    The most stable way of getting the number parameter I'm using so far:

    function getProp(app, name, dflt, toNum) {
    var prop = app.getProperty(name);
    return prop == null ? dflt : (toNum && (prop has :toNumber) ? prop.toNumber() : prop);
    }

    // usage example for a datafield
    var bgColor = getProp(App.getApp(), "bgColor", getBackgroundColor(), true);