I don’t know how to check the versions of all the platforms, frameworks, boards, tools, etc that come with Platformio IDE on VSCode.
I haven’t been able to find out a way of getting what Arduino version is PlatformIO using, except reading some other comments in this forum saying that it is using v1.0.6.
This brings me to my next question: does PlatformIO have support for Arduino core v2 ?
It lists the platform version, and associated with that (if not changed manually with platform_packages), the package versions coming with it, such as the Arduino-ESP32 at version 1.0.6.
Then your sketch or a it uses library is not compatible with a higher Arduino-ESP32 core version.
More directly, given a platform version x.y.z, (e.g., 3.5.0), you can look into the platform’s platform.json file and see all the used packages and their versions, such as in
Through which you e.g. also see that the Arduino-ESP32 core package used for this platform version is ~3.10006.0, which in turn encodes 1.0.6.