Can't find Arduino.h

Problem. Can’t find Arduino.h

I’ve looked at several places on the internet to try and resolve this issue.

‘’'***********************************************
This is the error.

Starting build…
“C:\msys64\mingw64\bin\g++.exe” -fdiagnostics-color=always -g “C:\Users\jake\Documents\PlatformIO\Projects\Blink2_ESP32\src\main.cpp” -o “C:\Users\jake\Documents\PlatformIO\Projects\Blink2_ESP32\src\main.exe”
C:\Users\jake\Documents\PlatformIO\Projects\Blink2_ESP32\src\main.cpp:1:10: fatal error: Arduino.h: No such file or directory
1 | #include <Arduino.h>
| ^~~~~~~~~~~
compilation terminated.
Build finished with error(s).

  • The terminal process failed to launch (exit code: -1).
  • Terminal will be reused by tasks, press any key to close it.

‘’'***********************************************

The code, only 3 lines.

#include <Arduino.h> ==> there is a red squiggly line under this
void setup(){}
void loop(){}
‘’'***********************************************
The platformio.ini.

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
upload_port = COM3
‘’‘***********************************************
‘’’***********************************************

Here’s what I’ve done.

  1. Removed this folder: C:\Users\jake.platformio\
  2. The file is on my local drive,ie, not in the cloud.
  3. The file path doesn’t have long names.
  4. Looked around trying to disable intellisense but couldn’t determine how to do.
  5. Verified the location of Arduino.h at:
    C:\Users\jake.platformio\packages\framework-arduinoespressif32\cores\esp32

After deleting .platformio (#1 above) I did a rebuild and several of the folders were not there.
I suspect that’s because the build failed.

After each of the numbered items above I closed VSCode and reopenned. Also did several restarts.

To compile I’m using Terminal > Run Build Task. Have also used the arrow on the right upper corner.

You’re using the wrong buttons!

Either use the bottom tool bar and click the arrow button
image

or click on the Alien / Ant head on the left side and choose Build / Upload / Upload and Monitor

image