Can't import the Arduino I2S.h library: no such file or directory

I want to use the I2S library from Arduino framework, on an ESP32 board, but can’t import it.
A simple example like this doesn’t compile

#include <Arduino.h>
#include "I2S.h"

void setup()
    Serial.println("initialization done.");

    I2S.begin(I2S_PHILIPS_MODE, 16000, 16);

void loop()

My platformio.ini file:

platform = espressif32
board = esp32dev
framework = arduino

Why can’t PIO find Arduino’s I2S library? How can I make it work?

If it can’t find the file then your Espressif32 platform is either corrupted or out of date. As a quick fix, open a CLI and execute

pio upgrade --dev
pio pkg update -g -p espressif32

And compile the project again. Does it work now?