Hey all,
I'm using the Arduinodroid Android app to work on my project. To give you some context; my project compiles successfully on the Arduino web editor. But when I try to compile my project on Arduinodroid I get the following error:
ITEADLIB_Arduino_Nextion/NexUpload.h:20:16: fatal error: SD.h: No such file or directory
#include <SD.h>
^
gcjr
February 10, 2020, 7:14pm
2
is that file available in your "Arduidroid" environment? is the SD library installed in that environment?
gcjr:
is that file available in your "Arduidroid" environment? is the SD library installed in that environment?
Yeah the SD library is installed. I even deleted it and re added it to make sure.
I'm sorry, do you mean the NexUpload.h file?
That file is this:
/**
* @file NexUpload.h
*
* The definition of class NexUpload.
*
* @author Chen Zengpeng (email:<zengpeng.chen@itead.cc>)
* @date 2016/3/29
*
* @copyright
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#ifndef __NEXUPLOAD_H__
#define __NEXUPLOAD_H__
#include <Arduino.h>
#include <SPI.h>
#include <SD.h>
#include "NexHardware.h"
/**
* @addtogroup CoreAPI
* @{
*/
/**
*
* Provides the API for nextion to download the ftf file.
*/
class NexUpload
{
public: /* methods */
/**
* Constructor.
*
* @param file_name - tft file name.
* @param SD_chip_select - sd chip select pin.
* @param download_baudrate - set download baudrate.
*/
NexUpload(const char *file_name,const uint8_t SD_chip_select,uint32_t download_baudrate);
/**
* Constructor.
*
* @param file_Name - tft file name.
* @param SD_chip_select - sd chip select pin.
* @param download_baudrate - set download baudrate.
*/
NexUpload(const String file_Name,const uint8_t SD_chip_select,uint32_t download_baudrate);
/**
* destructor.
*
*/
~NexUpload(){}
/*
* start download.
*
* @return none.
*/
void upload();
private: /* methods */
/*
* get communicate baudrate.
*
* @return communicate baudrate.
*
*/
uint16_t _getBaudrate(void);
/*
* check tft file.
*
* @return true if success, false for failure.
*/
bool _checkFile(void);
/*
* search communicate baudrate.
*
* @param baudrate - communicate baudrate.
*
* @return true if success, false for failure.
*/
bool _searchBaudrate(uint32_t baudrate);
/*
* set download baudrate.
*
* @param baudrate - set download baudrate.
*
* @return true if success, false for failure.
*/
bool _setDownloadBaudrate(uint32_t baudrate);
/**
* start dowload tft file to nextion.
*
* @return none.
*/
bool _downloadTftFile(void);
/*
* Send command to Nextion.
*
* @param cmd - the string of command.
*
* @return none.
*/
void sendCommand(const char* cmd);
/*
* Receive string data.
*
* @param buffer - save string data.
* @param timeout - set timeout time.
* @param recv_flag - if recv_flag is true,will braak when receive 0x05.
*
* @return the length of string buffer.
*
*/
uint16_t recvRetString(String &string, uint32_t timeout = 100,bool recv_flag = false);
private: /* data */
uint32_t _baudrate; /*nextion serail baudrate*/
const char *_file_name; /*nextion tft file name*/
File _myFile; /*nextion ftf file*/
uint32_t _undownloadByte; /*undownload byte of tft file*/
uint8_t _SD_chip_select; /*sd chip select pin*/
uint32_t _download_baudrate; /*download baudrate*/
};
/**
* @}
*/
#endif /* #ifndef __NEXDOWNLOAD_H__ */
gcjr
February 10, 2020, 7:30pm
4
I mean SD.h. Are you sure the library is properly installed and that file exists?
gcjr:
I mean SD.h. Are you sure the library is properly installed and that file exists?
It shows up in the library manager under installed libraries. There is a file called SD.h in the library.
pert
February 11, 2020, 4:12am
6
Try adding this line to the top of your sketch:
#include <SD.h>
Years ago, the Arduino IDE required you to add #include directives for all library dependencies to the sketch. Since that time, the Arduino IDE's dependency resolution system has been improved so that is no longer required, so you will find newer sketches often don't bother to clutter the sketch up with #include directives that are no longer necessary. It's possible that the Arduinodroid app has not been updated to match the modern capabilities of the Arduino IDE and the Arduino Web Editor.
pert:
Try adding this line to the top of your sketch:
#include <SD.h>
Thanks that solved that error. However I am getting a new errors, and since the app won't let me copy the error text I can't share what the error says (I manually copied the text for the previous error).
Actually here you go I took a screenshot of the error
(Attached below)