how to find a "Unhandled Exception"

My Watch Aopp is working ok in sim with vivoactive3 and/or fenix5, but when running under fenix3 i got jsue an "Unhandled Exception" message in Eclipse, with no more explanation.
In trying to understand all my traces/println got me is some WatchUI.requestUpdate() as last line of code but with more or less confidence as commenting it out just got me some more loop before crashing !
  • In your app, are you sure you're not trying to use something that's only available on devices with CIQ2 or CIQ3? The Fenix3 is CIQ1.

    Another possibility is you are trying to use more memory than is available on the F3 The f3 is a bit odd with an app that records an activity. While it's listed as 64k, about 4k gets grabbed as soon as you start recording.
  • In your app, are you sure you're not trying to use something that's only available on devices with CIQ2 or CIQ3? The Fenix3 is CIQ1.

    Another possibility is you are trying to use more memory than is available on the F3 The f3 is a bit odd with an app that records an activity. While it's listed as 64k, about 4k gets grabbed as soon as you start recording.


    How can I check thoses things ?
    * way to check API ?
    * way to check memory usage ? yes I record an activty, but it crash just a few second after my app start, and recording as not even been set up !
  • Have you tried the debugger or just adding Sys.println calls to narrow down where this is happening?

    If you're trying to use something that's only CIQ2/3, you should get an error about that in the console. The memory viewer in the sim will show memory, along with the bottom line in the sim window.

    You can add Sys.getSystemStats().freeMemory/usedMemory to your println calls to watch it too
  • Have you tried the debugger or just adding Sys.println calls to narrow down where this is happening?

    If you're trying to use something that's only CIQ2/3, you should get an error about that in the console. The memory viewer in the sim will show memory, along with the bottom line in the sim window.

    You can add Sys.getSystemStats().freeMemory/usedMemory to your println calls to watch it too


    yes i've added println, which got me narrowed to "WatchUI.requestUpdate()" !!! commenting out this line, got me some more loops but after that, crash with same exception !
    so i am in the dark !
    as for memory, from what I've seen in sim windo (note that I've just a few second before crash!) it seem to be way from the limit but not sure
  • This is a device app, correct? With the Ui.requestUpdate, could it be you're calling that repeatedly without returning to the vm? It doesn't actually do the onUpdate() request, but just queues the request for the next time the app returns to the VM. Maybe you're queuing up too many requests?

    In device apps, I have a timer, and that timer calls Ui.RequestUpdate (often once a second)
  • This is a device app, correct? With the Ui.requestUpdate, could it be you're calling that repeatedly without returning to the vm? It doesn't actually do the onUpdate() request, but just queues the request for the next time the app returns to the VM. Maybe you're queuing up too many requests?

    In device apps, I have a timer, and that timer calls Ui.RequestUpdate (often once a second)


    Yes, it's a device app, and I have this type of code :

    // Handler for the timer callback
    function onTimer() {
    // for testing
    //mModel.generateTest();

    mModel.onTimer();
    WatchUi.requestUpdate();
    }

    / handle UI interraction ?
    function onShow() {
    // 1 Hz timer
    mTimer.start(method(:onTimer), 1000, true);
    }


    that's the only lines where I call requestUpdate() .
    How can I check that it's "too many"
  • It should only be one as onUpdate should run right after onTimer finishes, and onTimer is called every second.
  • well, i've not yet understand why, but reverting to my code of more/less 2 days ago seems to work ! I've check the diff but did not suceed to try finding what's going wrong !