[esp-idf] Failed build because "Multiple ways to build the same target were specified..."

I am trying to build my project with esp-idf framework with PlatformIO IDE plugin in VSCode. However, the build fails as shown below:

> Executing task: platformio run --environment esp32dev <

Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-espidf 3.40200.210118 (4.2.0) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - tool-ninja 1.7.1 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80400.210211 (8.4.0)
Reading CMake configuration...

*** Multiple ways to build the same target were specified for: /var/home/jaberan/Documents/PlatformIO/Projects/TOIcojavimkolikaty/.pio/build/esp32dev/esp_efuse_api.o  (from ['/var/home/jaberan/.platformio/packages/framework-espidf/components/efuse/src/esp32/esp_efuse_api.c'] and from ['/var/home/jaberan/.platformio/packages/framework-espidf/components/efuse/src/esp_efuse_api.c'])
File "/var/home/jaberan/.platformio/platforms/espressif32/builder/frameworks/espidf.py", line 607, in compile_source_files
==================================================================================== [FAILED] Took 3.22 seconds ====================================================================================
The terminal process "platformio 'run', '--environment', 'esp32dev'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

What I have tried:

  • General -> Clean
  • Reinstall esp-idf framework, platformio, even VSCode
  • Start new project with same source code

Do somebody know what could be the culprit of that and how to solve that? I would be very happy for any help! Thanks in advance!

I’ve seen this exact bug in a topic here before: Create a new project Error in platfromio ide with vscode! When modify the folder path of .platformio from "%HOMEPATH%\.platfromio" to Specified path. However there were no more responses after that.

Please post this bug in Issues · platformio/platform-espressif32 · GitHub for @valeros.

Bug posted: [esp-idf] Failed build because “Multiple ways to build the same target were specified…” · Issue #515 · platformio/platform-espressif32 · GitHub

1 Like