App crash in Rez.mcgen

Hi, my data field has started to crash on some devices (e.g. Edge Explore, Edge 520, 520 plus) after a recent FW update. I don't own any of these devices myself but manage to get the crash log from a user 

The CIQ_LOG shows this:

Error: Unhandled Exception
Time: 2024-05-11T08:00:02Z
Part-Number: 006-B3011-00
Firmware-Version: '5.40'
Language-Code: deu
ConnectIQ-Version: 4.2.4
Store-Id: f7d0d393-70ea-4c5f-83cf-f7d5d0f5ef12
Store-Version: 30
Filename: E57H4321
Appname: ...
Stack: 
  - pc: 0x3000421c
  - pc: 0x30003e34
  - pc: 0x100026d8
  - pc: 0x10001542
 

The first two addresses (starting with 0x3000) does not point to anything in my debug.xml file. The third address (0x100026d8 = 268445400) can be found in my debug.xml file:

debug.xml file:

<entry filename="C:\\Users\\fsall\\OneDrive\\Garmin\\Garmin Projects\\DexDF\\bin\\gen\\006-B3011-00\\source\\Rez.mcgen" id="39" lineNum="88" parent="globals/Rez/Layouts" pc="268445365" symbol="TopLeftLayout"/>
<entry filename="C:\\Users\\fsall\\OneDrive\\Garmin\\Garmin Projects\\DexDF\\bin\\gen\\006-B3011-00\\source\\Rez.mcgen" id="39" lineNum="89" parent="globals/Rez/Layouts" pc="268445406" symbol="TopLeftLayout"/>
 

It points to line 88 or 89 in the Rez.mcgen file, which looks like this:

88: var rez_cmp_local_textarea_value = new WatchUi.TextArea({:identifier=>"value", :color=>Graphics.COLOR_WHITE, :width=>(rez_cmp_local_var_dc_getWidth * (100 / 100.0)), :locX=>(rez_cmp_local_var_dc_getWidth / 2) - ((rez_cmp_local_var_dc_getWidth * (100 / 100.0)) / 2), :locY=>(rez_cmp_local_var_dc_getHeight * (50 / 100.0)), :text=>"", :justification=>Graphics.TEXT_JUSTIFY_CENTER|Graphics.TEXT_JUSTIFY_VCENTER, :height=>(rez_cmp_local_var_dc_getHeight * (60 / 100.0)), :font=>[local_Rez_Fonts_RobotoBold60,local_Rez_Fonts_RobotoBold50,local_Rez_Fonts_RobotoBold40,local_Rez_Fonts_RobotoBold30] as Array<Graphics.FontType>});
89:
90: return [rez_cmp_local_custom_drawable_24525874216697440285, rez_cmp_local_text_label, rez_cmp_local_text_message, rez_cmp_local_textarea_value] as Array<WatchUi.Drawable>;

I am using relative layouts with text areas and custom fonts:

Layout.xml:

<layout id="MainLayout">
        <drawable class="Background" />
        <label id="label" x="center" y="15%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_XTINY" />
        <label id="message" x="center" y="40%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER" font="Graphics.FONT_MEDIUM" />
        <text-area id="value" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" x="center" y="15%" width="100%" height="100%">
            <fonts>
                <font>@Fonts.RobotoBold80</font>
                <font>@Fonts.RobotoBold60</font>
                <font>@Fonts.RobotoBold50</font>
                <font>@Fonts.RobotoBold40</font>
                <font>@Fonts.RobotoBold30</font>
            </fonts>
        </text-area>
    </layout>

I have noticed for one device type having the same issue that if I revert back to my old layout, which does not have text areas and custom fonts, the problem seems to go away. I use the old layout style with devices that does not support text-areas (pre 3.1.0). But the Explore is on 3.1.0 and should support text-areas, accoring to this page: https://developer.garmin.com/connect-iq/compatible-devices/  And it used to work, until the latest software update. 

Is this a CIQ bug that got introduced with the last device software update?? Or am I doing something wrong? 

Cannot reproduce in sim, and problem exists only on a few devices. (all devices having issues seem to be 3.1.0 devices)   

Thanks! 
/fredrik

  • My 2 cents is if generated code is crashing, it can't possibly be your fault (unless you use a 3rd party tool to modify it somehow). Even if you "did something wrong", the compiler should fail gracefully and tell you why, instead of crashing in generated code.

    The fact that this used to work makes me even more sure this is a CIQ bug.

    I would fill out a bug report if I were you.

  • Thank you for taking time to respond. I think you are right. I have filed a bug report.