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?

  • Is this happening on the same devices with the same firmware, or the same devices with with different firmware?

  • Yes. Fenix 7X

    There were no firmvare updates today

    And it looks like the timer event has stopped working.

    This error appears only when I load the watchface from the store. There is no such error either in the simulator or when I do build for device and loading into the device

  • I don't mean today. Does this only happen with the newest FW for the f7x?

  • You have to find the place of error first.

    So in sim [File][delete all apps] and run app like "load from store".

  • [File][delete all apps]

    I think it won't have an effect. But I did it

    this error
    Error: File Not Found Error
    Details: 'Failed invoking <symbol>'
    was here

    		if (weatherUpdated != null || weatherUpdated >= Time.now().value() - 3600) {

    Storage is not defined during the first run. therefore returns null. and since there is a comparison operator "or", the second condition is checked. That's the mistake in it. Yes, it was my mistake
    Correct code is

    		if (weatherUpdated != null && weatherUpdated >= Time.now().value() - 1800) {

    I am waiting for the version update in the store and will check again tomorrow

  • as you see there is the effect you cleared storage and found line of error

  • Yes. But I did it on the device too.
    Now, when I downloaded the new version from the store, there was no installation error.
    The problem is solved. At least for two devices: Fenix7X and Venu2
    Thanks

  • Hi Oleg, I'm struggling hard to find where the problem is in my code. I understand that the background process is run before the storage is available. Resulting in null values.

    File->Delete all apps does not trigger the error on the simulator. But when I uninstall my watchface and install it again, it has an iq logo or doesn't show at all. Once you select it again everything works.

    I read a bunch of storage values in Background, because I have to make different web requests at different times.

    All that said, I have no idea what is the problem. I null check every value in my background code, and if it's null I exit background and return from the function.

    Do you have any tips on how to debug it better? The only idea I have is to make a print line after every line and sideload the whole thing... 

    EDIT: I think I'm facing a race condition. Sometimes I can install my watchface and it shows up without problems. Sometimes it throws an IQ logo. Could it be that Storage is written in the foreground and the value is read in the background at the same time, resulting in not a null but something else?

  • OK I found the problem. For anybody facing similar issues who can't solve it with the facts Oleg found:

    I though I'd be smart and set some Storage values in the watchface initialize function. The effect is that, on first installation, if your background service also tries to read those storage variables, it creates a race condition. 

    While the foreground process is just writing the storage, the background process reads a storage item that is not fully there yet, causing the app to crash without a stack information. 

    The solution was to remove all Storage.setValue() from the initialize function (and of course null check in the background process).

    Thanks for all your support! 

  • I've been thinking. What if we use Properties instead of Storage?
    Initial values can be set for properties and they are always defined.
    What will the more experienced comrades say to this?