Acknowledged
over 1 year ago

Relative Layouts with text-areas crash on Fenix 5x

Hi, I use relative layouts with text-areas in my watch face. When the user runs the watch face in preview it works fine, but when the user selects the watch face, it crashes and the watch reverts to the previous/default watch face. The crash log file has this:

Error: Symbol Not Found Error
Details: "Could not find symbol '<Toybox_WatchUi_TextArea_>>fitTextToArea>'"
Time: 2024-02-11T10:38:40Z
Part-Number: 006-B2604-00
Firmware-Version: '25.00'
Language-Code: eng
ConnectIQ-Version: 4.2.3
Filename: F97B28AD
Appname: Dexcom Watch Face
Stack: 
  - pc: 0x300026ea
  - pc: 0x300021f8
  - pc: 0x30001642
  - pc: 0x300015aa
  - pc: 0x10002753
    File: 'C:\Users\fsall\OneDrive\Garmin\Garmin Projects\DexFace\source\DexFaceView.mc'
    Line: 190
    Function: onUpdate
 

It crashes on line 190 in the onUpdate function in my view class. Line 190 has this:

View.onUpdate(dc);

The description in the crash log has: Details: "Could not find symbol '<Toybox_WatchUi_TextArea_>>fitTextToArea>'"

The target is Fenix 5x. 

Parents
  • Solved it by removing text-areas from my layouts for the Fenix 5x and replaced with labels. It seems Fenix 5x does not properly handle text-areas (that includes multiple fonts), which it should since it supports API 3.1.0. Text areas require API level 3.1.0 according to https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/TextArea.html

    Text areas work fine to compile and runs fine in the sim but crashes on target when the user applies the watch face.  

    This layout makes the watch face crash on target (fenix 5x):

    <text-area id="TimeLabel" x="center" y="55%" width="100%" height="30%" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" color="Graphics.COLOR_WHITE">
            <fonts>
                <font>Graphics.FONT_NUMBER_HOT</font>
                <font>Graphics.FONT_NUMBER_MEDIUM</font>
                <font>Graphics.FONT_NUMBER_MILD</font>
            </fonts>
        </text-area>

    And this one works:

     <label id="TimeLabel" x="50%" y="65%"  font="Graphics.FONT_NUMBER_MEDIUM" justification="Graphics.TEXT_JUSTIFY_CENTER" color="Graphics.COLOR_WHITE" background="Graphics.COLOR_TRANSPARENT"/>

    Nothing else was changed in the code. 

Comment
  • Solved it by removing text-areas from my layouts for the Fenix 5x and replaced with labels. It seems Fenix 5x does not properly handle text-areas (that includes multiple fonts), which it should since it supports API 3.1.0. Text areas require API level 3.1.0 according to https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi/TextArea.html

    Text areas work fine to compile and runs fine in the sim but crashes on target when the user applies the watch face.  

    This layout makes the watch face crash on target (fenix 5x):

    <text-area id="TimeLabel" x="center" y="55%" width="100%" height="30%" justification="Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER" color="Graphics.COLOR_WHITE">
            <fonts>
                <font>Graphics.FONT_NUMBER_HOT</font>
                <font>Graphics.FONT_NUMBER_MEDIUM</font>
                <font>Graphics.FONT_NUMBER_MILD</font>
            </fonts>
        </text-area>

    And this one works:

     <label id="TimeLabel" x="50%" y="65%"  font="Graphics.FONT_NUMBER_MEDIUM" justification="Graphics.TEXT_JUSTIFY_CENTER" color="Graphics.COLOR_WHITE" background="Graphics.COLOR_TRANSPARENT"/>

    Nothing else was changed in the code. 

Children
No Data