Acknowledged

BUG: Text-areas with custom fonts cause 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 device software update update. It seems to be a problem with the auto generated code in rez.mcgen.  

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="\\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="\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:

Rez.mcgen file:

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 suspect this is auto generated code to handly my layouts. I use relative layouts with text-areas and custom fonts:

<layouts>
    <!-- Large layout with elapsed time -->
    <layout id="MainLayoutXL">
        <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" x="center" y="20%" 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>
        <text-area id="minutes" x="center" y="75%" width="50%" height="25%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER" font="Graphics.FONT_XTINY" ></text-area>
    </layout>
    
    
    <!-- A generic, centered layout. -->
    <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>

    <!-- Layouts used for the for the four quadrants. -->
    <layout id="TopLeftLayout">
        <drawable class="Background" />
        <label id="label" x="center" y="50%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_XTINY" />
        <label id="message" x="center" y="60%" 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="50%" width="100%" height="60%">
            <fonts>
                <font>@Fonts.RobotoBold60</font>
                <font>@Fonts.RobotoBold50</font>
                <font>@Fonts.RobotoBold40</font>
                <font>@Fonts.RobotoBold30</font>
            </fonts>
        </text-area>
    </layout>
    <layout id="TopRightLayout">
        <drawable class="Background" />
        <label id="label" x="center" y="50%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_XTINY" />
        <label id="message" x="center" y="60%" 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="50%" width="100%" height="60%">
            <fonts>
                <font>@Fonts.RobotoBold60</font>
                <font>@Fonts.RobotoBold50</font>
                <font>@Fonts.RobotoBold40</font>
                <font>@Fonts.RobotoBold30</font>
                
            </fonts>
        </text-area>
    </layout>
    <layout id="BottomLeftLayout">
        <drawable class="Background" />
        <label id="label" x="center" y="10%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_XTINY" />
        <label id="message" x="center" y="20%" 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="5%" width="100%" height="60%">
            <fonts>
                <font>@Fonts.RobotoBold60</font>
                <font>@Fonts.RobotoBold50</font>
                <font>@Fonts.RobotoBold40</font>
                <font>@Fonts.RobotoBold30</font>
            </fonts>
        </text-area>
    </layout>
    <layout id="BottomRightLayout">
        <drawable class="Background" />
        <label id="label" x="center" y="10%" color="Graphics.COLOR_WHITE" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" font="Graphics.FONT_XTINY" />
        <label id="message" x="center" y="20%" 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="5%" width="100%" height="60%">
            <fonts>
                <font>@Fonts.RobotoBold60</font>
                <font>@Fonts.RobotoBold50</font>
                <font>@Fonts.RobotoBold40</font>
                <font>@Fonts.RobotoBold30</font>
            </fonts>
        </text-area>
    </layout>
</layouts>

I have noticed that if I revert back to my old layout, which does not have text areas and custom fonts, the problem goes away. My old layout style is used for devices that does not support text-areas (pre 3.1.0).

The Edge Explore device 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. I cannot reproduce the proble in sim, and problem exists only on a few devices. (all devices having issues seem to be 3.1.0 devices). Again, the problem started to show up only after a recent device software update.