Arduino IDE 2.3.7 is confusing the platform boards package version

I am having trouble compiling under MacOS BigSur (11.7.10) with IDE 2.3.7.

  • Sketch "A" has been compiled multiple times with Espressif's ESP32 version 2.0.17 and the latest version 3.3.5.
  • Sketch "B" has only been compiled with version 3.3.5.

The problem is that sketch "A" compiles successfully with version 2.0.17, while sketch "B" fails to compile with the following error:

Invalid FQBN: getting build properties for board esp32:esp32:esp32: invalid option 'ZigbeeMode'

Compilation error: Invalid FQBN: getting build properties for board esp32:esp32:esp32: invalid option 'ZigbeeMode'

I select "ESP32 Dev Module" for both. Below is a comparison of the Tools menu under 2.0.17.

Comparing the boards.txt files for versions 2.0.17 and 3.3.5, there are some differences, but the Zigbee related items have definitely been added.

esp32.menu.ZigbeeMode.default=Disabled
esp32.menu.ZigbeeMode.default.build.zigbee_mode=
esp32.menu.ZigbeeMode.default.build.zigbee_libs=
esp32.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router)
esp32.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
esp32.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote

But why are 3.3.5 settings being used under 2.0.17?

I thought maybe the compilation information was being cached, so I deleted ~/Library/Caches/arduino, but the problem persists.

I would like to know how to compile project "B" with 2.0.17.

I don't think I had this experience with IDE 2.3.4.

Thanks in advance.

sounds like some hidden build folder needs to be cleared for the project..

turn verbose on for compile and see if prints the location..

then close Arduino, delete that hidden folder, should be recreated..

good luck.. ~q

Hi @embeddedkiddie. The Arduino IDE developers are tracking this bug here:

It can be worked around by following this procedure:

  1. Select Arduino IDE > Quit Arduino IDE from the Arduino IDE menus if it is running.
    All Arduino IDE windows will close and the application will be exited.
  2. Delete the folder at the following path:
    /Users/<username>/Library/Application Support/arduino-ide/
    
    (where <username> is your macOS username)
    • :red_exclamation_mark: The /Users/<username>/Library/ folder is hidden by default. You can make it visible by pressing the Command+Shift+. keyboard shortcut.
    • :warning: Please be careful when deleting things from your computer. When in doubt, back up!
  3. Start Arduino IDE.

@qubits-us ,
Thank you for your comment. I always enable verbose when compiling. The FQBN error occurred immediately after the compilation started like this:

@ptillisch ,
Thank you for the solution that allows sketch 'B' to compile successfully with 2.0.17.

It is not currently a problem for me, but I would like to add that after executing 3., the following error was displayed in the Output Monitor:

Platform arduino:avr@1.8.6 already installed
Already installed Ethernet@2.0.2
Already installed Firmata@2.5.9
Already installed Mouse@1.0.1
Failed to install library: 'Arduino_BuiltIn:1.0.0'.
Error: 2 UNKNOWN: Library Keyboard@1.0.6 is already installed, but with a different version: Keyboard@1.0.5

Anyway, I marked this thread as resolved.
Thank you all.

Edit: I found the official document about "User data folder".
https://support.arduino.cc/hc/en-us/articles/4415103213714-Find-sketches-libraries-board-cores-and-other-files-on-your-computer
It says "Removing this folder can sometimes resolve problems with Arduino IDE." :wink:

1 Like

You are welcome. I'm glad it is working now.

This is expected. On the first run after a fresh installation, Arduino IDE automatically installs a collection of foundational libraries (these are referred to as the "built-in libraries". It then sets a flag so that it won't attempt to install them over again. That flag is stored in the data files under the "User data folder". So when you delete the folder, you simulate the fresh install conditions, and thus Arduino IDE attempts to install the built-in libraries again.

Arduino IDE is intentionally configured to not install each library if it finds that you already have an existing installation. The reason for this is the assumption is that if the user already has an installation of the library, they want to use that specific installation and would be unhappy if Arduino IDE automagically made another installation, which might be different and thus cause problems if used to compile the user's projects.

Installation of libraries is performed for Arduino IDE by a helper tool named Arduino CLI. Unfortunately Arduino CLI treats the skipping of installation of existing libraries as an error condition, which causes these confusing messages in Arduino IDE's "Output" panel under these conditions. The treatment as an error makes sense in the context of someone manually running Arduino CLI from the command line, since in that case they explicitly instructed Arduino CLI to install the library and thus the cancellation of that operation is likely to be unexpected. However, it doesn't make sense in the context of Arduino IDE automagically performing this operation for the user.

That said, this first run installation of the built-in libraries is something that will normally only ever occur once on each user's system. And it is increasingly rare that there would be existing library installations. It is true that these conditions may be present on the systems of users migrating from Arduino IDE 1.x to 2.x. However, since Arduino IDE was replaced over three years ago we expect that all beginners will start from Arduino IDE 2.x, and thus will not encounter these error messages. So there is little return on investment for allocating limited resources to polishing this user experience for the small portion of the user base who are finally now upgrading from 1.x to 2.x after years of deferring.

Thank you for the detailed explanation. Now I understand!