Error: Symbol Not Found Error when installing WF

I'm getting an IQ! error every time when I installing my watchface. Only once. The watchface can be selected and it works fine without this error.

When I uninstall WF and install it I'm getting IQ! again.

There is only one CIQ_LOG.BAK file in the folder with logs on Fenix 7X:

---
Error: Symbol Not Found Error
Details: 'Failed invoking <symbol>'
Time: 2022-06-06T12:21:44Z
Part-Number: 006-B3907-00
Firmware-Version: '8.35'
Language-Code: eng
ConnectIQ-Version: 4.1.3

How to find the error?

  • What do you see in the stack trace in the log file?  That will tell you where the crash occurred.

  • There is no log file.

    Only one CIQ_LOG.BAK without any stack traces

  • On device in folder //GARMIN/Apps/LOGS I have only one file CIQ_LOG.BAK

  • The .BAK vs .YML seems to occur when the log is uploaded to garmin for ERA.

    Do you have the background permission set for your watch face?  If you don't needed it and aren't set up for a background service, remove it, as otherwise, onAppInstall/onAppUpdate logic will try to load your entire WF as a background service.

  • This error does not appear in ERA.
    The background mode permission is set and it is needed for connection.
    is the ad enough (:background) to limit the parts of the code available in the background?

  • You don't want the annotation unless something is needed by the background, as the background has limited memory.  When your watch face does run, does the background run and the data gets updated?

  • yes. I take weather data from openweathermap.

  • So if you leave the WF running and do nothing else with the watch, the weather data updates as it should?

  • yes. once an hour with a successful update and once every 10 minutes if there is any error

    I start the timer like this:

            if (Properties.getValue("WeatherProvider") != 0 || !SC.doTimer()) { return; }
            if (System has :ServiceDelegate && Background has :registerForTemporalEvent) {
                var lastTime = Background.getLastTemporalEventTime();
                var weatherUpdated = Storage.getValue("weatherUpdated");
                if (lastTime == null) { Background.registerForTemporalEvent(Time.now()); }
                else if (weatherUpdated == null || weatherUpdated < Time.now().value() - 86400) { Background.registerForTemporalEvent(lastTime.add(new Toybox.Time.Duration(600))); } // 10 minutes from last update
                else { Background.registerForTemporalEvent(lastTime.add(new Toybox.Time.Duration(3600))); } // 1 hour from last update
            }

  • Once you start the temporal event, no need to keep starting it based on a timer.  And no need for  Background.registerForTemporalEvent(Time.now()); 

    in getInitalView, just do:

        	if(Toybox.System has :ServiceDelegate) {
        		Background.registerForTemporalEvent(new Time.Duration(10 * 60));
        	}

    for example