I'm trying to get properties working with my app, and everything is working fine in the simulator, but when I build for my device (fenix5xplus), it crashes as soon as I try to read a property using Application.Properties.getValue("my_prop").
Error: Unexpected Type Error Details: 'Failed invoking <symbol>' Time: 2022-02-10T16:34:10Z Part-Number: 006-B3111-00 Firmware-Version: '17.30' Language-Code: eng ConnectIQ-Version: 4.0.9 Filename: HRBackground Appname: HRBackground Stack: - pc: 0x10000e1b File: 'source-round-240x240/layouts.mc' Line: 27 Function: readStateFromProperties - pc: 0x10001793 File: source/FieldInfo.mc Line: 29 Function: readState - pc: 0x10001189 File: source/MyView.mc Line: 23 Function: initialize - pc: 0x100001e9 File: source/MyApp.mc Line: 39 Function: getInitialView
Note - its a fatal error, not an exception (ie its not that I don't *have* such a property; the property works fine in the simulator, and I can pull up the simulator's 'Edit Application.Properties Data' editor, and see all my properties there (and change them, and see the effect on my app in the simulator).
I tried guarding the Application.Properties.getValue() call with 'if (Application has :Storage) {}', and it still failed the same way. I tried additionally guarding it with 'if (Application has :Properties && Application.Properties has :getValue) {}' and it still failed the same way.
I tried 'System.println(new Lang.Method(Application.Properties, :getValue))', and my log file shows 'Obj:243' or some such, but then invoking the method fails in a similar way to the above (but works in the simulator).
I deleted the fenix5xplus device via the sdk manager, and re-downloaded it. I deleted my bin directory, and rebuilt. No change. I'm using Sdk 4.0.9.
If I comment out the code, so that my App will run, then various CIQ 3.x features work (such as getSettingsView(), and Menu2), so its not somehow stuck on an old CIQ version.
Is there some setting I need to enable? Is there something else I need to copy to the device besides the .prg file?