Watch app: Activity recording session.start() freezes the app and the simulator

Using the SDK 6.4.0

Device: FR265

function startSession() as ActivityRecording.Session {
  var session = ActivityRecording.createSession({ // set up recording session
    :name=>"Bouldering", // set session name
    :sport=>Activity.SPORT_ROCK_CLIMBING, // set sport type
    :subSport=>Activity.SUB_SPORT_BOULDERING // set sub sport type
  });
  if ((session != null) && (session.isRecording() == false)) {
    session.start();
  } else {
    System.println("cant start session because session is ==>" + session);
  }
  return session;
}
The app completely freezes along with the simulator. the only way out is to kill the simulator, because even trying to stop the app gets timeout with the launcher.
I tried running/debugging the `Activity Tracking` example from the SDK, same behaviour
  • I mean the Record Sample example app from the SDK

  • The record sample does very little on the display when it runs, and there are only to things, input wise, it handles

    Pressing the lower right button terminates the app.

    A long press of the middle left button starts or stops recording (the screen changes to show it's recording or not and the only time the screen changes)

    It runs fine for me.

    With a device-app, onUpdate() doesn't get called on a regular basis as happens with a watch face.  You need to do something like create a timer where each time it fires it does a WatchUi.requestUpdate().

  • HI 

    Thanks for the reply. In my app, I cant even get to the next code section because everything freezes after calling the `session.start()` function. I can replicate the same behaviour with the example app.

    I recorded the screen capture, to show what's happening

    Click here to play this video

    As you can see, after the breakpoint on the session.start()`

    it doesnt even get to the next line, the simulator freezes, none of the buttons/controls work. Even when trying to stop the app from IDE, connection to the simulator times out, and i have to try and stop is few times. 

    On the simulator side, everything is frozen, the only thing to do there is quit the simulator

  • I can't see mov files.  Try again with an MP4.  Are you on windows, a mac or linux?

    You didn't change anything in the record sample, correct? Nothing in the debug console with VSC?

  • oh, let me try that again. No, didnt change anything in the record sample. 

    I am using Mac, I even tried updating the SDK to 6.4.1, same behaviour. 

  • Have you tried running without debugging or breakpoints? (ctrl+f5 vs just f5).  I've never had any issue with the record sample (starting in 2015, so lots of devices and SDKs)

  • yea, i did, same thing. that's why i tried debugging to see where exactly it was getting stuck and seems to be the start function

    looking at the session object

    mData: null
    mFitContributorFields: null
    mSensorLogger: null

  • This seems specific to your machine.  Have you tried a full reboot?  Is your OS current?  There was a bug that was resolved by updating the OS on a mac. I'd also check the version of Java.

    https://forums.garmin.com/developer/connect-iq/f/discussion/353644/sdk-manager-keeps-not-responding/1703054#1703054

  • thanks for that. 

    After reading that post, i tried rebooting, and also updated the OS from 14.1 to the latest 14.1.2. still the same problem

    I am on java version 21 "openjdk 21.0.1 2023-10-17"

  • I suspect it's the Java.  Here's what I use and have for years:

    openjdk version "17.0.2" 2022-01-18
    OpenJDK Runtime Environment (build 17.0.2+8-86)
    OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)

    In the console in VSC I see C:\ciq\java\jdk-17.0.2\bin\java.exe