barrel compilation

I am trying to build a project with barrel.

but the compilation failed with :

StressIcon.mc:7:  Undefined symbol "meditateFontStress" detected.
BUILD: ERROR: Barrel build failed

and the failing sources is :module ScreenPicker {
    class StressIcon extends Icon {
        function initialize(icon) {
            icon[:font] = StatusIconFonts.fontMeditateIcons;
            icon[:symbol] = StatusIconFonts.Rez.Strings.meditateFontStress;
            
            Icon.initialize(icon);
        }

what's wrong ?

  • Is it possible that you have a typographical error? Can you show us the resources in the barrel, and maybe a bit more of your code? 

    We have several test apps that use resources in barrels, and they all run fine. The barrel code looks something like this:

    module Verification1 {
    
        var moduleVar = true;
    
        function moduleFunction() {
            return true;
        }
    }
    

    The strings.xml for that barrel looks like this:

    <strings>
        <string id="barrelString">String inside the barrel</string>
    </strings>
    

    The application code that uses the barrel resources looks like this:

    using Toybox.WatchUi;
    using Verification1;
    
    function testStrings() {
        var barrel1String = WatchUi.loadResource(Verification1.Rez.Strings.barrelString);
        return barrel1String.equals("String inside the barrel");
    }