Eclipse > VSC: Symbol Not Found

Hi,

As per a previous thread, I am moving all my 50 projects from Eclipse to VSC.  

I am getting a runtime error, which I wasn't getting previously

Error: Symbol Not Found Error 
Details: Could not find symbol 'DeviceName'

The resource file is, which is in a sub-folder.

<resources>
    <string id="AppName">hTemp</string>
    <string id="DeviceName">Vivoactive</string>
</resources>

It compiles and picks up the AppName ok.

Any ideas?

Thanks

Chris

  • Did you try using Eclipse to build this app (same folder)?  When I moved from Eclipse links to jungles with VS Code,  I did my initial testing with eclipse just to make sure things still worked there.

  • If you use git, do git grep -il appname and git grep -il devicename, compare the two and you should be able to figure out what is wrong. grep without the -l flag if the changes come from without your source directory. Perhaps you are calling devicename somewhere that isn't Rez.Strings.DeviceName. 

    When I use an incorrect Rez.Strings.Identifier I get: ERROR: fenix6xpro: /home/ciq/src/source/models/Profiles.mc:16: Undefined symbol ':C' detected. and it just doesn't compile. So something somewhere is using DeviceName and it is not called via Rez.Strings

    If I use Rez.Strings[DeviceName], that does die with a similar error message:

    Error: Symbol Not Found Error
    Details: Failed invoking <symbol>
    Stack:
    - initialize() at /home/ciq/src/source/models/Profiles.mc:16 0x10000799
    - initialize() at /home/ciq/src/source/BuggyApp.mc:18 0x10000032
    Encountered an app crash.

    But as you can see, it clearly shows a stacktrace and points where the error is.

  • is this function called from foreground?

    my strings.xml (in resources/strings/strings.xml so for all devices) looks like (eclipse):

    <strings>

        <string id="AppName">hTemp</string>

        <string id="DeviceName">Vivoactive</string> 

    </strings>

    And I'm not going to move to VC to the end :-) I don't understand why people change IDE, everything run well in eclipse (I use the last one 2022-06).

  • When I removed 

    <string id="AppName">hTemp</string>

    It failed to compile with

    A string resource matching the provided app name can't be found. You must provide a string resource for the app name.

    So I am confident it is compiling this file

    And I'm not going to move to VC to the end :-)

    In March, I was able to reinstall Eclipse, but a week ago, I couldn't get Eclipse to work as it I couldn't get the Garmin IQ Plug-In extension to install.

    Did you try using Eclipse to build this app (same folder)?

    It worked perfectly before, and I've not changed anything apart from moving to VSC and then use Barrels.  So I feel the problem maybe, it that the code is inside a Barrel and that's trying to look in the Barrel strings, not the Projects.  Any idea on how to solve this?

  • For barrel information: https://developer.garmin.com/connect-iq/core-topics/shareable-libraries/
    So you are saying that the code that calls the Rez.Strings is *inside* a barrel?

    That doesn't even compile.. ERROR: fenix6xpro: /home/ciq/barrels/OPN/source/X11/Resource.mc:52: Cannot find symbol ':DeviceName' on type '$.OPN.Rez.Strings'.

  • So you are saying that the code that calls the Rez.Strings is *inside* a barrel?

    Yes, so this is probably the issue.  Previously I used linked files to access shared modules, so only moving to Barrels, as part of the VSC.  It compiles fine for, and only fails at runtime

  • Barrels?  Are you trying to access this sting in a barrel?

    You may need

    <module name>.Rez instead of just Rez.

  • I really like to see your barrel and your project, because I'm not able to wrap my head around your setup. 

  • The barrels are new with the move to VS C, correct?  Try removing them as barrels but just use jungles to reference the mc file in the barrel project(s).  That was the sample I posted a while back.

  • You have to install one additional plugin before install ciq. I don't remember the name but have somewhere check list how to...