I am new to PlatformIO, and encountered this problem which doesn’t even let me start:
When I click the sidebar tab for PlatformIO in Visual Studio Code, it is stuck at “Initializing PlatformIO Core…” for multiple minutes before showing the PlatformIO sidepanel:
This does not only happen on the first startup either, but also happens if the tab was not active for some time (e.g. after spending some time in the folder tab).
I am running Windows 10 x64 on a reasonably fast desktop with an i9-9900k, and have a gigibit fiber internet connection.
What I’ve tried so far:
Uninstalled VS code and deleted its folders Appdata/Roaming/Code and Users/username/.vscode, then reinstalled vs code and the PlatformIO extension (the only other installed extension is C/C++)
Disabled Windows Defender Real Time Protection
Added Windows Defender exclusions for username/.platformio folder and vs code process
unplugged lan cable and tried without active internet connection
I have no project or folder open in vs code, and no platforms or libraries installed in pio
This really keeps me from using PlatformIO, so if anyone has a suggestion how to solve or debug this I’d be super grateful!
Everything up to but excluding [Extension Host] is in the console before clicking on the platformio sidebar. During the waiting time where it says “Initializing PlatformIO Core…” there are no new messages in the console. Then, after a minute or two, the remaining messages show up and the platformio interface shows up.
Maybe not connected to your case, but in my case was a problem with the corruption of the C/C++ extension. The solution was switching to the previous version of the C/C++ extension and after restarting updating back to the current version.
Thanks, @androzoid, for your hint. It is true, if the C/C++ extension is broken then the PlatformIO IDE extension will not be loaded because it depends on the C/C++ extension.
This disturbed me to a point of considering leaving vscode and platformio all together. But after calming down and reading/following @ivankravets and @androzoid tip up there, I just deleted the .vscode folder in my project directory. because the error in help/toggle developer tools/ console was like this
Activating extension ‘ms-vscode.cpptools’ failed: cannot open file:///d%3A/ydayada/yadayada/.vscode/c_cpp_properties.json Detail: File seems to be binary and cannot be opened as text.
turns out the cpp_properties.json file was disturbing the c/c++ dependency, which in turn disturbed the platformio and in the end disturbing my life.
I just deleted the entire .vscode directory and the thing got back to normal. hope you find your way. If I had caught it in time, I wouldnt have disturbed my entire environment deleting and uninstalling everything. wish you luck.
open explorer instead open your project path, for example the project path is “C:/arduino/test1”, in the “test1” folder look for the .pio and .vscode folders, and delete those 2 folders. then open vs code open project.
I also got the same problem and I tried everything mentioned above,
even tried deleting and reinstalling VSCode nothing worked.
I was able to fix the problem by deleting the project(which had problem loading) in documents folder.
This fixed the Issue.
Maybe it takes very long cuz its unable to load faulty projects