Complete
over 4 years ago

WERETECH-9471

Fixed

Sensor.setEnabledSensors exception on Venu, Vivoactive 4

I have been getting numerous reports of app crashes due to the Sensor.setEnabledSensors call. This is occurring on a Venu with the new 4.90 firmware, and I've had reports of possibly the same error on Vivoactive 3 and 4 watches after they received their most recent firmware updates in the past week.

My call is

 Snsr.setEnabledSensors( [Snsr.SENSOR_HEARTRATE,Snsr.SENSOR_BIKECADENCE,Snsr.SENSOR_BIKEPOWER] );

(which has been unchanged for literally years) and this is causing this error:
Error: Array Out Of Bounds Error
Details: 'Failed invoking <symbol>'

Removing Snsr.SENSOR_BIKEPOWER from the array does not make any difference.

Parents
  • We have been unable to reproduce this so far on a Venu or in the simulator using Firmware 5.00. Is there any more information you can provide? A full console log of the error. Are there any other initialized arrays that this may be referring to or code that references this array?

Comment
  • We have been unable to reproduce this so far on a Venu or in the simulator using Firmware 5.00. Is there any more information you can provide? A full console log of the error. Are there any other initialized arrays that this may be referring to or code that references this array?

Children
  • This does nor occur in the simulator. Here is a recent log from a user with a Venu with 5.00:

    Error: Array Out Of Bounds Error
    Details: 'Failed invoking <symbol>'
    Time: 2020-08-26T16:22:00Z
    Part-Number: 006-B3226-00
    Firmware-Version: '5.00'
    Language-Code: eng
    ConnectIQ-Version: 3.1.9
    Filename: A8PK2954
    Appname: dwMap
    Stack:
    - pc: 0x10002338
    File: '/Volumes/PersonalSSD/dynamicWatch/eclipse-workspace/watch/dynamic/source/dynamicModel.mc'
    Line: 288
    Function: accessGPS
    - pc: 0x100046a4
    File: '/Volumes/PersonalSSD/dynamicWatch/eclipse-workspace/watch/dynamic/source/dynamicView.mc'
    Line: 24
    Function: onShow

    That line is:

                Snsr.setEnabledSensors( [Snsr.SENSOR_HEARTRATE,Snsr.SENSOR_BIKECADENCE,Snsr.SENSOR_BIKEPOWER] );

    Commenting it out and sending a build to the user removes the crash.

    The calling code (second item in stack trace) is in the onShow of my main view:

        function onShow() {

    ...            m.accessGPS(true);

    ...

            }

        }