PlatformIO Community

Project suddenly can't find Arduino.h but all lip_deps build

Hi,

A project that I have been working on has lost the ability to find Arduino.h, after a clean all the libraries build find but main.cpp fails on the include of <Arduino.h>

Platformio.ini:

[env:mkrzero]

platform = atmelsam>

board = mkrzero
framework = arduino

lib_deps =

UIPEthernet@2.0.8
ArduinoJson@6.15.2

[env:pre_and_post_hooks]
platform = atmelsam
board = mkrzero
extra_scripts = pre:extra_script.py

main.cpp:

#include <Arduino.h>

Error:

#include <Arduino.h>
^~~~~~~~~~~
compilation terminated.
*** [.pio\build\pre_and_post_hooks\src\main.o] Error 1

Cannot remember changing anything and looks like all my other still working projects, any ideas?

Clean and build does not resolve it,

Thanks

David

The error message is from building the pre_and_post_hooks configuration. This configuration does not specify any framework. So it is to be expected that Arduino.h is not found.

You either want to:

  • add framework = arduino to the env:pre_and_post_hooks section, or
  • build mkrzero configuration instead.