Include file not found in browse.path

Before having started doing anything to a new project I get this error. I get squiggly lines under #include <Adafruit_SSD1306>

main

#include <Arduino.h>
#include <Adafruit_SSD1306>

void setup() {
  // put your setup code here, to run once:
}
void loop() {
  // put your main code here, to run repeatedly:
}

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
	adafruit/Adafruit SSD1306
	adafruit/Adafruit GFX Library@^1.10.13

I looked in the c_cpp_properties.json file of another project and discovered that two lines were missing from this failing project. I added them but the error didn’t go away. The lines point to libraries in .pio.libdeps.

    "configurations": [
        {
            "name": "PlatformIO",
            "includePath": [
                "e:/Documents/PlatformIO/Projects/Esp32_OLED_temp/include",
                "e:/Documents/PlatformIO/Projects/Esp32_OLED_temp/src",
                "e:/Documents/PlatformIO/Projects/Esp32_OLED_temp/.pio/libdeps/esp32dev/Adafruit SSD1306",
                "e:/Documents/PlatformIO/Projects/Esp32_OLED_temp/.pio/libdeps/esp32dev/Adafruit GFX Library",
                "C:/Users/hans/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config",
                "C:/Users/hans/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace",
                "C:/Users/hans/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update",

Have you made sure to use the project envrionment switcher to switcth to the esp32dev of the target project and also did aa Ctrl+Shift+P → Rebuild Intellisense? This should update the c_cpp_properties.json accordingly. The file is auto-generated, so it shouldn’t be me manually modified.

I got the message “multiple requests to rebuild the project” and it sounded ominous so I deleted the project, reloaded VC and started all over. I now know what mistake I made but that problem is gone now. The new error I got is strange considering I haven’t done anything, just adding two libraries and adding no code at all.
Code

#include <Arduino.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>

void setup() {
}
void loop() {
}

Platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps = 
	adafruit/Adafruit SSD1306@^2.5.1
	adafruit/Adafruit GFX Library@^1.10.13

Error

Compiling .pio\build\esp32dev\lib5d9\Adafruit GFX Library\Adafruit_SPITFT.cpp.o
In file included from .pio\libdeps\esp32dev\Adafruit GFX Library\Adafruit_GrayOLED.cpp:20:0:
.pio\libdeps\esp32dev\Adafruit GFX Library\Adafruit_GrayOLED.h:30:32: fatal error: Adafruit_I2CDevice.h: No such file or directory

Further add

   adafruit/Adafruit BusIO@^1.11.1

to the lib_deps.