DNSServer::operator= implicitly deleted by compiler

I have picked up my project after about 2 months of downtime and unable to compile it after updating everything.

The key error messages:

.pio/libdeps/d1_mini_pro/ESPAsyncWiFiManager/ESPAsyncWiFiManager.cpp: In member function 'boolean AsyncWiFiManager::startConfigPortal(const char*, const char*)':
.pio/libdeps/d1_mini_pro/ESPAsyncWiFiManager/ESPAsyncWiFiManager.cpp:551:24: error: use of deleted function 'DNSServer& DNSServer::operator=(const DNSServer&)'
  551 |   *dnsServer=DNSServer();
      |                        ^
In file included from .pio/libdeps/d1_mini_pro/ESPAsyncWiFiManager/ESPAsyncWiFiManager.h:31,
                 from .pio/libdeps/d1_mini_pro/ESPAsyncWiFiManager/ESPAsyncWiFiManager.cpp:14:
/Users/zmarkella/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src/DNSServer.h:67:7: note: 'DNSServer& DNSServer::operator=(const DNSServer&)' is implicitly deleted because the default definition would be ill-formed:
   67 | class DNSServer
      |       ^~~~~~~~~
/Users/zmarkella/.platformio/packages/framework-arduinoespressif8266/libraries/DNSServer/src/DNSServer.h:67:7: error: use of deleted function 'std::unique_ptr<_Tp [], _Dp>& std::unique_ptr<_Tp [], _Dp>::operator=(const std::unique_ptr<_Tp [], _Dp>&) [with _Tp = DNSS_REQUESTER; _Dp = std::default_delete<DNSS_REQUESTER []>]'
In file included from /Users/zmarkella/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/memory:83,
                 from /Users/zmarkella/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h:32,
                 from /Users/zmarkella/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h:28,
                 from /Users/zmarkella/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h:34,
                 from .pio/libdeps/d1_mini_pro/ESPAsyncWiFiManager/ESPAsyncWiFiManager.h:18,
                 from .pio/libdeps/d1_mini_pro/ESPAsyncWiFiManager/ESPAsyncWiFiManager.cpp:14:
/Users/zmarkella/.platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/unique_ptr.h:724:19: note: declared here
  724 |       unique_ptr& operator=(const unique_ptr&) = delete;

Why do I have an issue with a built-in DNSServer library? Has something changed and should some other parts of the code be updated?

The installed packages:

pio pkg list                            
Resolving d1_mini_pro dependencies...
Platform espressif8266 @ 4.2.0 (required: espressif8266)
├── framework-arduinoespressif8266 @ 3.30102.0 (required: platformio/framework-arduinoespressif8266 @ ~3.30102.0)
├── tool-esptool @ 1.413.0 (required: platformio/tool-esptool @ <2)
├── tool-esptoolpy @ 1.30000.201119 (required: platformio/tool-esptoolpy @ ~1.30000.0)
└── toolchain-xtensa @ 2.100300.220621 (required: platformio/toolchain-xtensa @ ~2.100300.0)

Libraries
├── Adafruit NeoPixel @ 1.11.0 (required: adafruit/Adafruit NeoPixel @ ^1.6.0)
├── ArduinoJson @ 6.21.2 (required: bblanchon/ArduinoJson @ ^6.20.1)
├── ESP Async WebServer @ 1.2.3 (required: me-no-dev/ESP Async WebServer @ ^1.2.3)
│   └── ESPAsyncTCP @ 1.2.2 (required: ESPAsyncTCP)
├── ESPAsyncWiFiManager @ 0.23.0 (required: alanswx/ESPAsyncWiFiManager @ ^0.23)
├── PubSubClient @ 2.8.0 (required: knolleary/PubSubClient @ ^2.8)
├── RFM69 @ 1.5.2 (required: lowpowerlab/RFM69 @ ^1.4.1)
│   └── SPIFlash @ 101.1.3 (required: SPIFlash)
└── Uptime Library @ 1.0.0 (required: yiannisbourkelis/Uptime Library @ ^1.0.0)

That one’s outdated – try specifying alanswx/ESPAsyncWiFiManager@^0.31.

Some update of the framework or platform (espressif8266) may have happened that introduced the incompatibility.

Best to also pin that + all library versions to exact versionss once you restored working compilation.

https://docs.platformio.org/en/latest/platforms/espressif8266.html#stable-and-upstream-versions

Thanks for the tip!
Interesting, as I included all the libraries with the recommended operator (^)

lib_deps=
  lowpowerlab/RFM69 @ ^1.4.1
  knolleary/PubSubClient @ ^2.8
  adafruit/Adafruit NeoPixel @ ^1.6.0
  yiannisbourkelis/Uptime Library @ ^1.0.0
  me-no-dev/ESPAsyncTCP @ ^1.2.2
  me-no-dev/ESP Async WebServer @ ^1.2.3
  alanswx/ESPAsyncWiFiManager @ ^0.23
  bblanchon/ArduinoJson@^6.20.1

I thought ^0.23 would be compatible with ^0.31.

Right, but PlatformIO would only pull the newest library versions of the library wasn’t already downloaded in .pio/libdeps. So probably deleting the .pio folder would have solved it too – but it’s good to track the exact version anyways.

Huh, it’s even weirder. I have removed the .pio directory to force a reinstall and voila:

Library Manager: Installing lowpowerlab/RFM69 @ ^1.4.1
Unpacking  [####################################]  100%
Library Manager: RFM69@1.5.2 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing SPIFlash
Unpacking  [####################################]  100%
Library Manager: SPIFlash@101.1.3 has been installed!
Library Manager: Installing knolleary/PubSubClient @ ^2.8
Unpacking  [####################################]  100%
Library Manager: PubSubClient@2.8.0 has been installed!
Library Manager: Installing adafruit/Adafruit NeoPixel @ ^1.6.0
Unpacking  [####################################]  100%
Library Manager: Adafruit NeoPixel@1.11.0 has been installed!
Library Manager: Installing yiannisbourkelis/Uptime Library @ ^1.0.0
Unpacking  [####################################]  100%
Library Manager: Uptime Library@1.0.0 has been installed!
Library Manager: Installing me-no-dev/ESPAsyncTCP @ ^1.2.2
Unpacking  [####################################]  100%
Library Manager: ESPAsyncTCP@1.2.2 has been installed!
Library Manager: Installing me-no-dev/ESP Async WebServer @ ^1.2.3
Unpacking  [####################################]  100%
Library Manager: ESP Async WebServer@1.2.3 has been installed!
Library Manager: Resolving dependencies...
Library Manager: Installing alanswx/ESPAsyncWiFiManager @ ^0.23
Unpacking  [####################################]  100%
Library Manager: ESPAsyncWiFiManager@0.23.0 has been installed!
Library Manager: Installing bblanchon/ArduinoJson @ ^6.20.1
Unpacking  [####################################]  100%
Library Manager: ArduinoJson@6.21.2 has been installed!

As you can see RFM69 was specified at 1.4.1, but installed the latest 1.5.2. Great! Same for ArduinoJson.
However, ESPAsyncWiFiManager is still not at its latest version… :thinking:

It might have a problem with this because it’s not strictly x.y.z version scheming conforming… Maybe a @^0 expression is better, interpolating from https://devhints.io/semver.

The versions are definitely listed here:

Ah, that’s an interesting catch! All of the other libraries are x.y.z and they were upgraded to the latest version.