I just got past a rather maddening round of debugging wherein I downloaded a vendor’s example project for a new ESP32-based board, and immediately thereafter all of my other ESP32 projects, which had previously been working fine, then failed to build with a myriad of build issues.
As near as I can tell, here’s what happened:
The new vendor example project happened to install a third-party fork of the PIO ESP32 platform, specifically platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 - which PIO installs as simply espressif32.
From that point forward, any other project which uses platform = espressif32 simply uses that third-party platform as-is instead of installing the first-party PIO espressif32 like it would if you were starting from scratch.
I found that by using platform = platformio/espressif32 it would go and install the first-party one, at which point my other projects returned to building successfully.
So, just sharing this as a cautionary tale. Most places in the docs seem to use platform = espressif32 in example code, but it seems a little wiser to me to be more explicit and use platform = platformio/espressif32 to help mitigate this particular risk that a given project could get broken because of a global environment change that was caused by some other project.