String does not name a type
String is included by Arduino.h. Before #include &lt;Arduino.h&gt; String is not defined. Move #include &lt;Arduino.h&gt; to the top of the file or remove it. If you remove it, the Arduino builder adds it.