[ISSUE] Could not find task: Flash application (local) for <directory>/ParticleWorkbench/<project name>

Hi,

When I press the ‘flash project’ button (the one with the flash symbol), then I receive the following message, and it doesn’t run:
Could not find task: Flash application (local) for /ParticleWorkbench/

However, if I click [terminal]->[Run Build Task…]->Particle: Flash application (local), the flashing happens without trouble.

I have not experienced this problem until I installed the VIM visual studio code extension (vscodevim version: 1.14.5)

The two problems may be unrelated, but I cannot think of anything else that I could have changed.

How can I restore the functionality of that button?


I run Ubuntu 18.04

Here the output of Audit:


{
    "username": "username",
    "workspace": {
        "name": "ProjectName",
        "isWorkspace": false,
        "folders": [
            {
                "location": "/home/username/Documents/PhD/ProjectName/code/ParticleWorkbench/ProjectName",
                "hasValidPath": true,
                "settings": {
                    "firmwareName": "deviceOS",
                    "firmwareVersion": "1.5.2",
                    "targetDevice": "P2",
                    "targetPlatform": "photon",
                    "compileButtonAction": "localAppDeviceOS",
                    "flashButtonAction": "localAppDeviceOS",
                    "disableWelcomeScreen": false,
                    "disableDeviceOSOutdatedCheck": false,
                    "disableLocalCompilerDirtyCheck": false,
                    "enableVerboseLocalCompilerLogging": false,
                    "compileDefines": [],
                    "customDeviceOSLocation": "",
                    "maxAllowedToolchains": 4
                },
                "files": [
                    ".git",
                    ".git/COMMIT_EDITMSG",
                    ".git/HEAD",
                    ".git/branches",
                    ".git/config",
                    ".git/description",
                    ".git/hooks",
                    ".git/index",
                    ".git/info",
                    ".git/logs",
                    ".git/objects",
                    ".git/refs",
                    ".vscode",
                    ".vscode/launch.json",
                    ".vscode/settings.json",
                    ".vscode/tasks.json",
                    "README.md",
                    "lib",
                    "lib/json.hpp",
                    "project.properties",
                    "src",
                    "src/ProjectName.cpp",
                    "src/ProjectName.ino",
                    "target",
                    "target/1.5.2"
                ]
            }
        ]
    },
    "cli": {
        "binpath": "/home/username/.vscode/extensions/particle.particle-vscode-core-1.12.0/src/cli/bin/linux/amd64/particle",
        "ok": true,
        "version": "2.7.0",
        "installed": 1590696658620
    },
    "localCompiler": {
        "ok": true,
        "dependencies": [
            {
                "id": "deviceOS@1.5.2",
                "ok": true
            },
            {
                "id": "gcc-arm@5.3.1",
                "ok": true
            },
            {
                "id": "buildtools@1.1.1",
                "ok": true
            },
            {
                "id": "buildscripts@1.9.2",
                "ok": true
            },
            {
                "id": "openocd@0.11.2-adhoc6ea4372.0",
                "ok": true
            }
        ]
    },
    "platform": {
        "os": "linux",
        "type": "Linux",
        "release": "5.3.0-53-generic",
        "arch": "x64",
        "path": {
            "key": "PATH",
            "value": "/home/username/miniconda3/bin:/home/username/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
        },
        "homeDir": "/home/username",
        "particleDir": "/home/username/.particle",
        "localCompilerToolchainDir": "/home/username/.particle/toolchains"
    },
    "env": {
        "ELECTusername_RUN_AS_NODE": "1",
        "USER": "username",
        "TEXTDOMAIN": "im-config",
        "XDG_SEAT": "seat0",
        "XDG_SESSION_TYPE": "x11",
        "SSH_AGENT_PID": "1976",
        "SHLVL": "1",
        "QT4_IM_MODULE": "xim",
        "HOME": "/home/username",
        "DESKTOP_SESSION": "ubuntu",
        "GTK_MODULES": "gail:atk-bridge",
        "GNOME_SHELL_SESSION_MODE": "ubuntu",
        "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus",
        "IM_CONFIG_PHASE": "2",
        "LOGNAME": "username",
        "GTK_IM_MODULE": "ibus",
        "USERNAME": "username",
        "XDG_SESSION_ID": "3",
        "WINDOWPATH": "2",
        "PATH": "/home/username/miniconda3/bin:/home/username/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin",
        "XDG_RUNTIME_DIR": "/run/user/1000",
        "DISPLAY": ":1",
        "LANG": "en_US.UTF-8",
        "XDG_CURRENT_DESKTOP": "Unity",
        "XDG_SESSION_DESKTOP": "ubuntu",
        "XMODIFIERS": "@im=ibus",
        "XAUTHORITY": "/run/user/1000/gdm/Xauthority",
        "SSH_AUTH_SOCK": "/run/user/1000/keyring/ssh",
        "SHELL": "/bin/bash",
        "QT_ACCESSIBILITY": "1",
        "GDMSESSION": "ubuntu",
        "TEXTDOMAINDIR": "/usr/share/locale/",
        "GPG_AGENT_INFO": "/run/user/1000/gnupg/S.gpg-agent:0:1",
        "XDG_VTNR": "2",
        "QT_IM_MODULE": "ibus",
        "PWD": "/home/username",
        "CLUTTER_IM_MODULE": "xim",
        "XDG_DATA_DIRS": "/usr/share/ubuntu:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop",
        "XDG_CONFIG_DIRS": "/etc/xdg/xdg-ubuntu:/etc/xdg",
        "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated",
        "XDG_MENU_PREFIX": "gnome-",
        "SESSION_MANAGER": "local/usernamecore:@/tmp/.ICE-unix/1881,unix/usernamecore:/tmp/.ICE-unix/1881",
        "GIO_LAUNCHED_DESKTOP_FILE": "/usr/share/applications/code.desktop",
        "GIO_LAUNCHED_DESKTOP_FILE_PID": "12201",
        "GJS_DEBUG_OUTPUT": "stderr",
        "GJS_DEBUG_TOPICS": "JS ERROR;JS LOG",
        "CHROME_DESKTOP": "code-url-handler.desktop",
        "VSCODE_NLS_CONFIG": "{\"locale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}",
        "VSCODE_NODE_CACHED_DATA_DIR": "/home/username/.config/Code/CachedData/5763d909d5f12fe19f215cbfdd29a91c0fa9208a",
        "VSCODE_LOGS": "/home/username/.config/Code/logs/20200608T150025",
        "VSCODE_IPC_HOOK": "/run/user/1000/vscode-e6977acd-1.45.1-main.sock",
        "VSCODE_PID": "12201",
        "CONDA_DEFAULT_ENV": "base",
        "CONDA_EXE": "/home/username/miniconda3/bin/conda",
        "CONDA_PREFIX": "/home/username/miniconda3",
        "CONDA_PROMPT_MODIFIER": "(base) ",
        "CONDA_PYTHON_EXE": "/home/username/miniconda3/bin/python",
        "CONDA_SHLVL": "1",
        "LESSCLOSE": "/usr/bin/lesspipe %s %s",
        "LESSOPEN": "| /usr/bin/lesspipe %s",
        "LS_COLORS": "",
        "_": "/usr/share/code/code",
        "_CE_CONDA": "",
        "_CE_M": "",
        "AMD_ENTRYPOINT": "vs/workbench/services/extensions/node/extensionHostProcess",
        "PIPE_LOGGING": "true",
        "VERBOSE_LOGGING": "true",
        "VSCODE_IPC_HOOK_EXTHOST": "/tmp/vscode-ipc-67865dac-2127-40ac-b94b-a0e0f7edddcb.sock",
        "VSCODE_HANDLES_UNCAUGHT_ERRORS": "true",
        "VSCODE_LOG_STACK": "false",
        "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "true"
    },
    "versions": {
        "node": "12.8.1",
        "v8": "7.8.279.23-electusername.0",
        "uv": "1.30.1",
        "zlib": "1.2.11",
        "brotli": "1.0.7",
        "ares": "1.15.0",
        "modules": "75",
        "nghttp2": "1.39.2",
        "napi": "4",
        "llhttp": "1.1.4",
        "http_parser": "2.8.0",
        "openssl": "1.1.0",
        "cldr": "35.1",
        "icu": "64.2",
        "tz": "2020a",
        "unicode": "12.1",
        "electusername": "7.2.4"
    },
    "vscode": {
        "appName": "Visual Studio Code",
        "appRoot": "/usr/share/code/resources/app",
        "machineId": "classified",
        "sessionId": "classified",
        "version": "1.45.1"
    },
    "extensions": [
        {
            "id": "ms-vscode.js-debug-companion",
            "version": "1.0.0"
        },
        {
            "id": "ms-vscode.node-debug",
            "version": "1.44.5"
        },
        {
            "id": "ms-vscode.node-debug2",
            "version": "1.42.2"
        },
        {
            "id": "ms-vscode.references-view",
            "version": "0.0.51"
        },
        {
            "id": "marus25.cortex-debug",
            "version": "0.3.6"
        },
        {
            "id": "ms-vscode.cpptools",
            "version": "0.28.2"
        },
        {
            "id": "particle.particle-vscode-core",
            "version": "1.12.0"
        },
        {
            "id": "particle.particle-vscode-pack",
            "version": "1.12.0"
        },
        {
            "id": "particle.particle-vscode-snippets",
            "version": "1.12.0"
        },
        {
            "id": "particle.particle-vscode-theme",
            "version": "1.12.0"
        }
    ]
}

Ping @m_m

1 Like

this is the info we need to help troubleshoot:

I updated my question to the best of my abilities.

what file is open when you click the button? can you try opening ./src/ProjectName.ino then clicking again?

The issue occurs with the ProjectName.ino file open. (The button does not appear without a code file open)

try sharing the contents of ./.vscode/tasks.json here and then delete it or move it out of the project

My ./.vscode/tasks.json

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "particle",
			"name": "Flash application (local)",
			"problemMatcher": [
				"$particle-gcc"
			],
			"group": "build",
			"label": "Particle: Flash application (local)"
		}
	]
}

After renaming tasks.json to tasks_OLD.json, the button works again. What might have been the issue causing this problem?

After renaming tasks.json to tasks_OLD.json, the button works again.

good

What might have been the issue causing this problem?

no idea. do you recall creating that file? perhaps by clicking “Configure Tasks…” in VSCode’s “Terminal” menu?

If I did, it was unintentional.

Thank you for helping me out.

1 Like