why Symbol Not Found error for global variables?

Former Member
Former Member

Recently ERA reports that many users have the Symbol Not Found Error.

But the code looks OK (I actually put the checking cod [ if ($ has :variable_name) ] to make sure, but the error is happening on this line.

Does anyone know what's wrong with my code??

////////////////
// globals
...

var ana_1hz = 1;

...

class MyDelegate extends Toybox.WatchUi.WatchFaceDelegate {
...
        function onPowerBudgetExceeded(powerInfo) {
...
                if ($ has :ana_1hz){ $.ana_1hz = 0; }
...
        }
}

  • Check the firmware version in the ERA, as there's a known problem where apps can be installed on devices that don't have the proper minimum.

    And weird things can happen.

    Also, looks like you're missing the initialize() in your delegate - that should cause this error but you should get a compile warning.

    function initialize() {
    WatchFaceDelegate.initialize();
    }

  • Former Member
    0 Former Member over 5 years ago in reply to jim_m_58

    Thank you for the advice, seems like their firmware is not latest...

    Strangely "Too Many Arguments Error" happening in the same line:

    Error Name: Symbol Not Found Error
    Occurrences: 2
    First Occurrence: 2020-02-13
    Last Occurrence: 2020-02-13
    Devices:
        vívoactive® 3: 5.70
    App Versions: 0.11.3e
    Languages: spa
    Backtrace:
        bc01.onPowerBudgetExceeded:3603
    
    
    Error Name: Too Many Arguments Error
    Occurrences: 237
    First Occurrence: 2019-11-28
    Last Occurrence: 2020-02-28
    Devices:
        fēnix® 6S Pro / 6S Sapphire: 3.00
        fēnix® 6 Pro / 6 Sapphire: 3.00
        fēnix® 6X Pro / 6X Sapphire / 6X Pro Solar: 3.10
    App Versions: 0.11.3e
    Languages: ara, deu, eng, pol, rus, spa
    Backtrace:
        bc01.onPowerBudgetExceeded:3603
    
    
    Error Name: Symbol Not Found Error
    Occurrences: 337
    First Occurrence: 2019-11-25
    Last Occurrence: 2020-04-07
    Devices:
        fēnix® 6S Pro / 6S Sapphire: 2.10, 2.20
        fēnix® 6 Pro / 6 Sapphire: 2.20
        vívoactive® 3 Music: 4.50
        fēnix® 6X Pro / 6X Sapphire / 6X Pro Solar: 2.30
        vívoactive® 3 Music LTE: 3.50
        vívoactive® 4: 3.40, 2.70, 3.20
        MARQ™ Expedition: 3.20
        vívoactive® 3: 6.60, 6.40
        vívoactive® 4S: 3.40, 2.70
    App Versions: 0.11.3e
    Languages: ces, dan, deu, eng, fre, gre, ita, pol, por, rus, spa, tur
    Backtrace:
        bc01.onPowerBudgetExceeded:3603
    

    The actual code is below, so maybe the users' firmware are just too old?

    
    class MyDelegate extends Toybox.WatchUi.WatchFaceDelegate {
            function initialize(){
                    Toybox.WatchUi.WatchFaceDelegate.initialize();
            }
            function onPowerBudgetExceeded(powerInfo) {
                System.println( "Average execution time: " + powerInfo.executionTimeAverage );
                System.println( "Allowed execution time: " + powerInfo.executionTimeLimit );
                if ($ has :alwaysActive){ $.alwaysActive = false; }
                if ($ has :ana_1hz){ $.ana_1hz = 0; } 
            }
    }
    
    

    Probably I should put the warning notice to the app page, "Please update firmware of your device" or something, I guess..