How to fix ESP32 PlatformIO esp_https_server.h: No such file or directory


When compiling your PlatformIO project, you see a compiler error like

src/main.cpp:6:10: fatal error: esp_https_server.h: No such file or directory

at the following line:

#include <esp_https_server.h>


The ESP32 HTTPS server library is not included with the older versions of arduino-espressif32. The solution therefore is to use a more recent version of the platform library such as version 2.0.4. In order to do that, add the following line to your platformio.ini:

platform_packages = framework-arduinoespressif32 @

Complete platformio.ini example:

platform = espressif32
platform_packages = framework-arduinoespressif32 @
board = esp32dev
framework = arduino
monitor_speed = 115200