I ran into this “No Such File or Directory” myself when I downloaded a sketch from the IoT Cloud environment. I opened it up in the Arduino IDE. When I pressed Sketch Upload I got this precise error message “ArduinoIoTCloud.h: No such file or directory“.
If you run into these errors, the chance is big that you forgot to import a Library in your Arduino IDE.
Unfortunately, Arduino doesn’t give hints that can help beginners (Processing, a creative software tool, does a better job in this).
You get this “No such file or directory” error when you don’t install a library. The default functionality in Arduino can be extended by libraries. In this case, a library that includes all the functionality to connect to the Arduino IoT Cloud service.
How do you figure out which library is missing when you get the “no such file or directory” error?
My tip is to search for the plain file. So, in this situation, “ArduinoIoTCloud.h”. Most Arduino code is open-source and published on GitHub. Lucky for us, code shared on Github is well-indexed by engines like Google and DuckDuckGo.
This will lead you to ArduinoIoTCloud/src/ArduinoIoTCloud.h
How do you install an Arduino library?
You can download the code from Github and copy it to your library directory.
An easier way is to add the library in the Library Manager.
Go to Sketch > Include Library > Manage Libraries …
Type in the name “ArduinoIoTCloud”, select it in the list and press Install.
Press Install and make sure you install the library, including all of its dependencies (other libraries that this library uses).
I hope I could help you move forward. Have fun playing with Arduino and check some of my other articles in my Arduino category.