The Environment:
- MacOS 10.13
- Eclipse Oxygen.1a Release (4.7.1a)
Detailed description:
My "UTC Titanium" watch face functions properly with the current CIQ implementations (CIQ 1.4.x and CIQ 2.3.x) however users running beta versions with CIQ 2.4 were reporting that the watch face crashes. I can confirm that the crash also happens on the simulator running the SDK 2.4 beta. This is without any code changes whatsoever.
The simulator reports the crash happens when calling the drawCircle but only when passing it a specific constant from a module in another file, which contains all the constants. If I move this constant further down in the module then the crash happens somewhere else, at the first use of the constant now in the position of the original constant. The position happens to be the 17th constant in my file and this only appears to be an issue when calling draw methods on a Dc object from a BufferedBitmap. Calls to draw methods on devices running CIQ 1.4 or calling System.println with that constant work as expected, passing in the numerical value.
My constant module looks something like this...
module DeviceOverride {
const SOME_VALUE_00 = 1;
const SOME_VALUE_01 = 1;
const SOME_VALUE_02 = 1;
const SOME_VALUE_03 = 1;
...
const SOME_VALUE_16 = 1;
const SOME_VALUE_17 = 1; // passing this constant to a method seems to send a Class reference
const SOME_VALUE_18 = 1;
}
Passing the 16th and 18th values to a method is fine but passing the 17th constant causes the following error, as displayed in the console...
(null)
Unhandled Exception
UnexpectedTypeException: Expected Number/Float/Boolean/Long/Double, given Class definition
native function
native function
onUpdate in /Users/douglasr/develop/garmin/watchfaces/UTCTitanium/source/UTCTitaniumView.mc:199
The quick fix is simply to add a bogus, unused constant in the 17th position and everything seems to work again. I added a bunch of other bogus constants to see if it occurs in any kind of pattern but it only seems to crash when accessing the 17th constant, which in my case is a number but is being passed as a Class.
Steps to reproduce:
1. Load project "UTCTitaniumCrash" in Eclipse (NOTE: project has been emailed to Connect IQ team only)
2. Run project.
3. See simulator crash.
4. To see simulator run fine, uncomment the BOGUS constant on line 40 of Fenix5.mc source file.
5. Scratch your head as to what is going on.
Additional information:
None.
Code sample:
Emailed a stripped down version to Connect IQ team.