Hello,
I´ve got the:
Error: System Error
Details: Failed invoking <symbol>
Stack:
- messageReceived() at C:\Users\smiea\eclipse-workspace\tst\source
avApp.mc:84 0x100008a2
Can´t really understand or I´m completely blind and don´t see the cause, why my app crashes on entering for loop. Has anyone bumped into this aswell?
SDK version 3.2.x, Vívoactive 4S
This is whole function, which is called when I got message from phone with data, that needs to be parsed.
function messageReceived(message){ if(message.data["type"].toString().equals("routeSteps")){ try{ routeSteps = parseRouteSteps(message); //Storage.setValue("routeSteps", routeSteps); System.println("routeSteps parsed"); } catch(ex){ System.println(ex.getErrorMessage()); } } if(message.data["type"].toString().equals("routePoints")){ try{ routePoints = parseWayPoints(message); //Storage.setValue("routePoints", routePoints); System.println("routePoints parsed"); } catch(ex){ System.println(ex.getErrorMessage()); } } if(message.data["type"].toString().equals("boundingBox")){ boundingBox = new [2]; boundingBox[0] = new Position.Location({ :latitude => message.data["data"][1], :longitude => message.data["data"][0], :format => :degrees}); boundingBox[1] = new Position.Location({ :latitude => message.data["data"][3], :longitude => message.data["data"][2], :format => :degrees}); latLongToPixels = new [routePoints.size()]; topLeft = new MyReferencePoint(26, 36, boundingBox[1].toDegrees()[0], boundingBox[1].toDegrees()[1]); bottomRight = new MyReferencePoint(191, 181, boundingBox[0].toDegrees()[0], boundingBox[0].toDegrees()[1]); topLeft.setGlobalXY(latlngToGlobalXY(topLeft.latitude, topLeft.longitude, topLeft, bottomRight)); bottomRight.setGlobalXY(latlngToGlobalXY(bottomRight.latitude, bottomRight.longitude, topLeft, bottomRight)); for(var i = 0; i < routePoints.size(); i++){ System.println("Pozice: " + i + " Lat: " + routePoints[i].toDegrees()[1] + " Lon: " + routePoints[i].toDegrees()[0]); latLongToPixels[i] = latlngToScreenXY(routePoints[i].toDegrees()[0], routePoints[i].toDegrees()[1], topLeft, bottomRight); System.println("Pozice: " + i + " X: " + latLongToPixels[i][0] + " Y: " + latLongToPixels[i][1]); } //Storage.setValue("latLongToPixels", latLongToPixels); System.println("bb ok"); } }
This is the bit of code throwing the error. Checked that, the routePoints array is not null.(always got size with initialized Location values).
for(var i = 0; i < routePoints.size(); i++){ //line 84 in my code latLongToPixels[i] = latlngToScreenXY(routePoints[i].toDegrees()[0], routePoints[i].toDegrees()[1], topLeft, bottomRight); }