IconMenuItem symbol not found error

Hi I've never touched coding in my life but am trying to make a Garmin app. U had everything running fairly smoothly up until I wanted to add Icons into my menu2 screen. It functioned fine with just MenuItem, and the icons I want to use have been used on other screens within the app without issue.

I'm using whatever the most recent SDK is and was using api 4.0.0 then bumped it up to 5.0.0 but saw no changes.

Any help is much appreciated!!

using Toybox.WatchUi;
using Toybox.Application;

class TimerMenuView extends WatchUi.Menu2 {
    function initialize() {
        Menu2.initialize({
            :title => "Select Timer"
        });

        var breathIcon = Application.loadResource(Rez.Drawables.breath_32);
        var historyIcon = Application.loadResource(Rez.Drawables.history_32);

        addItem(new WatchUi.IconMenuItem(
            "15 seconds",
            null,
            :fifteen,
            breathIcon,
            null
        ));
        
        addItem(new WatchUi.IconMenuItem(
            "20 seconds",
            null,
            :twenty,
            breathIcon,
            null
        ));
        
        addItem(new WatchUi.IconMenuItem(
            "30 seconds",
            null,
            :thirty,
            breathIcon,
            null
        ));
        
        addItem(new WatchUi.IconMenuItem(
            "60 seconds",
            null,
            :sixty,
            breathIcon,
            null
        ));
        
        addItem(new WatchUi.IconMenuItem(
            "History",
            null,
            :history,
            historyIcon,
            null
        ));
    }
}

  • Hi again, got it all working!! Thanks everyone who dm'd and helped out. For reference the issue was that I wasn't defining the icons as bitmaps and inserting the bitmaps properly. Previously they were defined in a seperate screen utils file. The code is below!!

    class BitmapIconDrawable extends WatchUi.Drawable {
    private var _bitmap;

    function initialize(bitmap) {
    Drawable.initialize({});
    _bitmap = bitmap;
    }

    function draw(dc) {
    if (_bitmap != null) {
    var x = (dc.getWidth() - _bitmap.getWidth()) / 2;
    var y = (dc.getHeight() - _bitmap.getHeight()) / 2;
    dc.drawBitmap(x, y, _bitmap);
    }
    }
    }

    class TimerMenuView extends WatchUi.Menu2 {
    var _inactivityTimer;
    const INACTIVITY_TIMEOUT_MS = 60000; // 60 seconds

    function initialize() {
    Menu2.initialize({:title => "Select Duration"});

    // START icon loading
    var fifteenBitmap = ScreenUtils.getFifteenIcon();
    var twentyBitmap = ScreenUtils.getTwentyIcon();
    var thirtyBitmap = ScreenUtils.getThirtyIcon();
    var sixtyBitmap = ScreenUtils.getSixtyIcon();
    var historyBitmap = ScreenUtils.getHistoryIcon();

    var fifteenIcon = new BitmapIconDrawable(fifteenBitmap);
    var twentyIcon = new BitmapIconDrawable(twentyBitmap);
    var thirtyIcon = new BitmapIconDrawable(thirtyBitmap);
    var sixtyIcon = new BitmapIconDrawable(sixtyBitmap);
    var historyIcon = new BitmapIconDrawable(historyBitmap);
    // END icon loading

    // START menu item setup
    addItem(new WatchUi.IconMenuItem(
    "15 seconds",
    null,
    "fifteen",
    fifteenIcon,
    {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}
    ));

    addItem(new WatchUi.IconMenuItem(
    "20 seconds",
    null,
    "twenty",
    twentyIcon,
    {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}
    ));

    addItem(new WatchUi.IconMenuItem(
    "30 seconds",
    null,
    "thirty",
    thirtyIcon,
    {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}
    ));

    addItem(new WatchUi.IconMenuItem(
    "60 seconds",
    null,
    "sixty",
    sixtyIcon,
    {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}
    ));

    addItem(new WatchUi.IconMenuItem(
    "History",
    null,
    "history",
    historyIcon,
    {:alignment=>WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT}
    ));
    // END menu item setup