Under Review
over 1 year ago

Ticket resolved with 4.0.7

Run App fails with timeout

Running an app often fails with the following error message:

"Failed to launch the app: Timeout"

The workaround is to try again a couple of times until it works.

Environment:

  • Visual Studio Code
  • Windows 11
  • Monkey C plugin 1.0.0

In some cases (for specific apps), Run App fails consistently, and the only workaround is to copy over the PRG file manually. This specific case was seen with Monkey C plugin v0.1.13, as well.

See thread:

https://forums.garmin.com/developer/connect-iq/f/discussion/276200/vscode-extension-failed-to-launch-the-app-timeout

  • Same issue on Ubuntu 20.04.
    plugin version 1.0.1 

    Simulation on Eclipse still works for me.

  • I tried another location closer to the filesystem root (/test/MyProj/bin/MyProj.prg), made sure the permissions were set properly, but still the file in /tmp/GARMIN/APPS/MEDIA is not updated/created

  • as you can see, my project's bin folder has no spaces, but I still see this issue.

  • I did a good bit of troubleshooting today and yesterday, hopefully this will help with resolving it.

    First and foremost:

    • OS: Linux (Manjaro), kernel version 5.15
    • Connect IQ SDK version 4.07
    • Monkey C Plugin version 1.0.1
    • Application type: Audio Content Provider
    • VSCode version 1.63.2

    Observed behaviour

    Running the default launch configuration - i.e., choosing Run > Run Without Debugging without a custom .vscode/launch.json in my workspace - often fails. There seems to be two issues.

    1. The app builds successfully at <workspace>/bin/<app-name>.prg, and the simulator opens if it is not already. But the app sometimes does not launch in the simulator, showing the following error message in the Debug Console: 

      Failed to launch the app: Timeout


    2. Same as 1., except the run does succeed (i.e., above error doesn't appear, and the app launches in the simulator) - but code updates are not reflected on subsequent launches.
      For instance, if I change the label of a MenuItem from "Label A" to "Label B", and then relaunch the app (with Run > Run Without Debugging), the label will still say "Label A".

    Others have observed that the PRG file launched by the simulator is located at something like /tmp/GARMIN/APPS/ (OS-dependent), or /tmp/GARMIN/APPS/MEDIA/ if the PRG file is for an Audio Content Provider. Let's say the file is called /tmp/GARMIN/APPS/MEDIA/MYPROJ.PRG. I've observed the below about this file, in relation to the two issues above.

    1. In the case of issue 1 (the "Failed to launch the app: Timeout" error), this seems to be because the MYPROJ.PRG file does not exist. Only the PRG file in the workspace folder (e.g., ~/repos/MyProj/bin/) gets created.

      ❯ ls -l /tmp/GARMIN/APPS/MEDIA
      total 0
      ❯ ls -l ~/repos/MyProj/bin
      total 168
      -rw-r--r-- 1 murchu27 murchu27 101116 Jan  1 12:24 MyProj.prg
      -rw-r--r-- 1 murchu27 murchu27  65904 Jan  1 12:24 MyProj.prg.debug.xml


      If I copy ~/repos/MyProj/bin/MyProj.prg to /tmp/GARMIN/APPS/MEDIA/MYPROJ.PRG and Run > Run Without Debugging again, the app successfully launches in the simulator.
    2. This brings us to issue 2 (code updates not being reflected). After copying ~/repos/MyProj/bin/MyProj.prg to /tmp/GARMIN/APPS/MEDIA/MYPROJ.PRG, the app will run in the simulator. But after making code changes and relaunching, the PRG file in the workspace folder (~/repos/MyProj/bin/) gets rebuilt, while the PRG file launched by the simulator (/tmp/GARMIN/APPS/MEDIA/MYPROJ.PRG) hasn't changed.

      ❯ ls -l /tmp/GARMIN/APPS/MEDIA
      total 100
      -rwxr-xr-- 1 murchu27 murchu27 101116 Jan  1 12:25 MYPROJ.PRG
      ❯ ls -l ~/repos/MyProj/bin
      total 168
      -rw-r--r-- 1 murchu27 murchu27 101116 Jan  1 12:31 MyProj.prg
      -rw-r--r-- 1 murchu27 murchu27  65904 Jan  1 12:31 MyProj.prg.debug.xml

    Seems to me like there is something wrong with the step of the launch that is meant to copy the built app at ~/repos/MyProj/bin/MyProj.prg to the simulator's folder at /tmp/GARMIN/APPS/MEDIA/MYPROJ.PRG

    Expected behaviour

    The app that gets built in the workspace directory (~/repos/MyProj/bin/MyProj.prg) is consistently copied to the simulator's directory (/tmp/GARMIN/APPS/MEDIA/MYPROJ.PRG), so that the app always launches, and reflects the current code.


    Hope this helps with the debugging

  • I did have one folder with a space in it, but removing that space did not fix the problem. I now have zero spaces in the entire file path, and the problem persists. Eclipse works fine, however.