Can't compile a project based on esp32s3 in arduino framework

I am not able to compile a esp32s3 based project in platformio with arduino framework.

I found out the problem. The problem is arduino-framework is being compiled for esp32. So it can only compile esp32 based projects. If I need to compile a esp32s3 based project in platformio I need to remove the arduino-framework lib from platformio lib folder and then compile the project. Now I wont be able to compile a esp32 based project. Now if i want to compile a esp32 based project, then again I need to remove the current arduino-framework folder from the platformio lib folder and compile a esp32 based project.

Is it an issue that i am only facing? Is there a workaround so that I can run both esp32 and esp32s3 based projects without re downloading arduio framework in platformio.

It works fine when I am using Arduino-IDE. it wont get into such problems.

Can this be solved ?

What? o_o.

The framework-arduinoespressif32 package is exactly https://github.com/espressif/arduino-esp32/, working for all ESP32-series chips, ESP32 and ESP32S3 alike. There should be no problem with chosing an ESP32S3-based board and compiling with the Arduino framework. The CI checks do that and it goes through fine.

I more suspect that you have a very broken platfomio.ini, please show that.

It belongs to 2 projects. One is having

[env:esp32s3box] platform = espressif32 board = esp32s3box framework = arduino

and the other is having

[env:esp32doit-devkit-v1] platform = espressif32 board = esp32doit-devkit-v1 framework = arduino

Please show a full screenshot of VSCode with the error message and the file explorer visible, and src/ and lib/ expanded.