Expected Number/Float/Long/Double, given Number/String

Hi,

I've got a weird error from a user on a Edge 1000. It's an established Simple Data Field, and they are reporting a crash.

Using a Debug version, the error is 'Expected Number/Float/Long/Double, given Number/String'.

Now, here's the weird bit, the line is 'return -2;'

Any ideas?

Cheers
Chris
  • Hey Chris,

    If you're getting that info, are you also getting a line number? If so, what call is returning the -2? Are you using a partner app or any info coming from GCM. We have had some type errors in the past that should be addressed by now. Do you know if they are using an up to date version of GCM if that's applicable?

    Thanks,
    -Coleman
  • Hey Chris,

    If you're getting that info, are you also getting a line number? If so, what call is returning the -2? Are you using a partner app or any info coming from GCM. We have had some type errors in the past that should be addressed by now. Do you know if they are using an up to date version of GCM if that's applicable?

    Thanks,
    -Coleman


    Thanks Coleman for the response. I have a full stack trace:
    UnexpectedTypeException: Expected Number/Float/Long/Double, given Number/String
    distanceNext in C:\Users\chares.BLUEVENN\OneDrive\Eclipse\Projects\IQDataFieldPaceFinishCycle\source\IQDataFieldPaceFinishCycleView.mc:47
    compute in C:\Users\chares.BLUEVENN\OneDrive\Eclipse\Projects\IQDataFieldPaceFinishCycle\source\IQDataFieldPaceFinishCycleView.mc:261


    Working backwards, Line 261 in IQDataFieldPaceFinishCycleView is
    displayIndex = distanceNext(distanceUnits, info.elapsedDistance);

    And Line 47 in IQDataFieldPaceFinishCycleView is:
    return -2;

    The lines around it are:
    function distanceNext(distanceUnits, distanceElapsed)
    {
    if (distanceElapsed == null)
    {
    return -2;
    }


    Any ideas?
    Cheers
    Chris
  • Ok, I have now manged, with User help, to recreate this in the simulator. If the numeric settings property comes through as a string, which seems to happen from Garmin Connect on Android, I get the same crash on the same line.

    However, it's still the odd 'return -2;' line.

    Please help!
  • Ok, I?ve got some more information.

    The issue sue is actually on 2 lines lower. The first line (the lowest) is corrected, however the failure line (highest in the file) is 2 short.

    The problem is due to the Android GMC saving a numeric value as a string, which when compared using a greater than is failing.

    So 2 questions:
    1. Why is one call stack line 2 out?
    2. Is the Android GCM still writing numeric settings as strings?

    Thanks
    Chris