Hello everyone ,I need help here. here is the thing:
I tried to declare an array to store the Garmin Weather conditions in an array so I can use them easyly in my watchface .
I set them in strings
<string id="CONDITION_CLEAR" >Clear</string> <string id="CONDITION_PARTLY_CLOUDY">Partly cloudy</string> <string id="CONDITION_MOSTLY_CLOUDY">Mostly cloudy</string> <string id="CONDITION_RAIN">Rain</string> <string id="CONDITION_SNOW">Snow</string> <string id="CONDITION_WINDY">Windy</string>
and then I declared a global const
import Toybox.System; var CONDITIONS2 = [ Rez.Strings.CONDITION_CLEAR, Rez.Strings.CONDITION_PARTLY_CLOUDY, Rez.Strings.CONDITION_MOSTLY_CLOUDY, Rez.Strings.CONDITION_RAIN, Rez.Strings.CONDITION_SNOW, Rez.Strings.CONDITION_WINDY, ..., ];
but use nothing nowhere .
when I run in sim, it comes out error in debug console:
Error: Illegal Access (Out of Bounds) Details: Could not access symbol 'Rez' Stack: - <init>() at E:\watchface1\MyProject\source\global.mc:3 0x10000e9d - Native code0x80000000
but the watchface works well.(maybe because I didn't used it anywhere )
So I tried to see if the array works
for(var i = 0 ; i < $.CONDITIONS2.size();i++){ System.println(WatchUi.loadResource($.CONDITIONS2[i])); }
to my superise, it works fine.
so there is the question:
What caused the ERROR?
I tried to make a brand new project, and added the string and the const, it works perfect without any ERROR appear.
So, I think maybe some of my code triggered the ERROR. but after a long time work, I still can't figure out the problem.
plz help me .