Build fails (undefined reference to typeinfo for BTAdvertisedDevice)

Somebody on reddit helped me find the root cause. espressif32 includes their own BluetoothSerial.{cpp/hpp} now, which caused the conflict with the types from mbed.

The solution was to set the

lib_ldf_mode = deep

and then remove the mbed dependency, after which everything worked flawlessly.