I installed a library but when it compiles the code it uses the wrong includes

I am using a M5 Timer Camera, which is some sort of ESP32-Cam but with low power mode.
Everything worked fine, until I decided to use some newer features available in the updated ESP32-camera library. Until now, I didn’t have the library installed, and instead it was using the include files from the esp32 SDK: /.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h

I installed the library, added it to my project, but it still insist to use the wrong headers (from the sdk, not the library). The one it should use is here: \PlatformIO\Projects\240403-155026-m5stack-timer-cam.pio\libdeps\m5stack-timer-cam\esp32-camera\driver\include

My platformio.ini looks like so:
[env:m5stack-timer-cam]

platform = espressif32

board = m5stack-timer-cam

framework = arduino

lib_deps =

m5stack/Timer-CAM@^1.0.0

espressif/esp32-camera@^2.0.4

I am relatively new to Pltaformio, any ideas on what I am doing wrong?
Thanks for reading!

The builder script is hardcoded to use the ESP-IDF libraries (of which libesp32-camera.a is one of them).

You would have to either delete the ones in the Arduino core or write a script that removes the build flags (include, linker) for the version inside the Arduino core.

Oh, I thought there was a simpler way. I only needed a small function from the new library, and I can just use the code of that function in my project, with less trouble.

On top of that, Platformio doesn’t let me upload the program to the device, but Arduino does. No idea what’s wrong, I’ve seen others with the same problem and no answers… It’s strange, it works fine with my other boards.