Fix “WARNING: library … claims to run on avr architecture(s)”
A warning, not an error: the library’s metadata only lists AVR. Many such libraries still work on ESP32. If it compiles, test it; if not, use an ESP32 version.
Community draft — report a mistake
What you see
WARNING: library LiquidCrystal I2C claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).
LiquidCrystal_I2C.h:53:12: warning: 'B00000001' is deprecated: use 0b00000001 instead [-Wdeprecated-declarations]
53 | #define Rs B00000001 // Register select bit
| ^~~~~~~~~
Sketch uses 284492 bytes (21%) of program storage space. Maximum is 1310720 bytes.
Global variables use 23508 bytes (7%) of dynamic memory, leaving 304172 bytes for local variables. Maximum is 327680 bytes.WARNING: library LiquidCrystal I2C claims to run on avr architecture(s) and may be incompatible with your current board which runs on esp32 architecture(s).
LiquidCrystal_I2C.h:53:12: warning: 'B00000001' is deprecated: use 0b00000001 instead [-Wdeprecated-declarations]
53 | #define Rs B00000001 // Register select bit
| ^~~~~~~~~
Sketch uses 284492 bytes (21%) of program storage space. Maximum is 1310720 bytes.
Global variables use 23508 bytes (7%) of dynamic memory, leaving 304172 bytes for local variables. Maximum is 327680 bytes.
The Arduino IDE reads each library’s library.properties. When its architectures= line doesn’t include your board’s family, it prints this warning. The compiler still tries — and for many simple libraries, it succeeds and the library works.
Only act on it if the build then fails or the device misbehaves on the board.
Quick fix — try in order
- 1
Check whether the build finished
If “Sketch uses … bytes” follows, it compiled. The warning comes from the
architectures=avrline in the library’s library.properties, not from the code. - 2
Test it on the board
Libraries that only use Wire, SPI and digitalWrite (LCD backpacks, many sensors) usually work fine. LiquidCrystal I2C works on ESP32 and ESP8266.
- 3
If it fails to compile, use a port
Libraries that touch AVR registers (PORTB, TIMER1, avr/io.h) can’t work. Look for ESP32 versions: ESP32Servo instead of Servo, ESP32 TimerInterrupt instead of TimerOne, Adafruit NeoPixel instead of old WS2812 code.
- 4
The B00000001 deprecation warning
Arduino-ESP32 3.x marks the old B-binary constants deprecated. Harmless; newer library versions use
0b00000001.
Why it happens
Why does the IDE warn at all?
Library authors list the architectures they tested. The IDE warns when your board isn’t on the list — it doesn’t check the code.
Can I silence it?
Editing the library’s library.properties to add esp32 removes it, but is undone by updates. It is safe to ignore once you’ve tested the library.
Compile fails with avr/… errors
Then the library really is AVR-only. See Servo library on ESP32 for the most common case.
Board-specific notes
ESP32: Full tested setup for the LCD: ESP32 DevKit V1 with 16×2 I2C LCD (needs a level shifter or 3.3 V-tolerant backpack).
ESP8266: Same warning, same rule — compile and test.
Did this fix it?
Thanks — that helps us keep this page right.