Do you have any other extensions installed in VSCode besides PlatformIO and C/C++ by microsoft that could interfere, e.g. ESP-IDF or CMake? Try and disable those if yes.
What is the project structure like? (Screenshot of file explorer in VSCode)
There are few google hits on esp-idf file "failed to open for reading" git-data/head-ref
.
A few info I could collect
-
If the project has run
git init
but there are no commits (therefor no revision) the build will fail will the output below - updating has helped before (Could Not Import Project Error while Importing Example Project - #10 by mntolia) but you already seem to be using the latest platform version. You can still try and use the upstream version in the
platformio.ini
- try to import an example project by going to PIO Home → Platforms → Espressif 32 → Examples → espidf-blink → Import and try and build that
If neither works, please file an issue in Issues · platformio/platform-espressif32 · GitHub.