Complete
over 4 years ago

WERETECH-8583

Annoying warning: Unable to detect scope 'MenuItem' for the symbol 'initialize'

Hi,

Since using the Menu2 framework from CIQ3, I get annoying warnings in the compiler logs:

WARNING: C:\connectiq\test\source\MainMenu.mc:14: Unable to detect scope 'MenuItem' for the symbol 'initialize'.

WARNING: C:\connectiq\test\source\MainMenu.mc:20: Unable to detect scope 'CheckboxMenuItem' for the symbol 'initialize'.

WARNING: Rez:188: Unable to detect scope 'ToggleMenuItem' for the symbol 'initialize'.

Everything works correctly, it only seems to be a warning to be ignored. Any idea how to get rid of this?

Also, any idea how to get to the Rez resource and find what Rez:188 corresponds to?

Thanks!

  • Thanks Travis.

    Actually, I was using 3.1.6. I updated to the latest 3.1.7 SDK and the warnings from the mc files are gone.

    Only the Rez warnings remain. Thanks for opening a ticket.

  • You can usually fix these warnings (at least the ones in MainMenu.mc) by adding the appropriate using clause. In this case you could add a
    using Toybox.WatchUi;
    at the top of the file, and then make sure you're qualifying references to the classes you're using:
    var item = new WatchUi.CheckboxMenuItem(label, subLabel, ident, checked, options);
    //             ^^^^^^^^
    The warning from inside the Rez code may actually be an issue with the compiler not properly generating qualified references to some classes. I'll take a peek to see if I can find where that might be coming from.