Hi guys, I want to ask. I just wrote a code and it didn't success compiling, and it's say multiple library were found and i don't included to the code. Is there wrong whit my code. please help!
When you encounter an error, you'll see a button on the right side of the orange bar "Copy error messages" in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button..
In a forum reply here, click on the reply field.
Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
Press "Ctrl + V". This will paste the error between the code tags.
Move the cursor outside of the code tags before you add any additional text to your reply.
If the text exceeds the forum's 9000 character limit, save it to a .txt file and post it as an attachment. If you click the "Reply" button here, you will see an "Attachments and other settings" link.
Arduino: 1.8.10 (Mac OS X), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:39:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:87:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:102:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp: In member function 'message TelegramBot::getUpdates()':
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:39:20: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:39:37: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:44:12: error: 'ArduinoJson::JsonObject' has no member named 'success'
if(root.success()){
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp: In member function 'String TelegramBot::sendMessage(String, String)':
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:87:19: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:87:36: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:93:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
buff.printTo(msg);
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp: In member function 'String TelegramBot::sendMessage(String, String, TelegramKeyboard&, bool, bool)':
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:102:19: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:102:36: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:107:68: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonObject& {aka ArduinoJson6130_000001::ObjectRef&}' from an rvalue of type 'ArduinoJson6130_000001::ObjectRef'
JsonObject& reply_markup = buff.createNestedObject("reply_markup");
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:108:66: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonArray& {aka ArduinoJson6130_000001::ArrayRef&}' from an rvalue of type 'ArduinoJson6130_000001::ArrayRef'
JsonArray& keyboard = reply_markup.createNestedArray("keyboard");
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:111:48: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonArray& {aka ArduinoJson6130_000001::ArrayRef&}' from an rvalue of type 'ArduinoJson6130_000001::ArrayRef'
JsonArray& row = keyboard.createNestedArray();
^
In file included from /Users/rizkyakhbar/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/cores/esp8266/Arduino.h:29:0,
from /Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.h:10,
from /Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:8:
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:117:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("one_time_keyboard", one_time_keyboard);
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:117:20: error: expected ';' before 'bool'
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:118:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("resize_keyboard", resize_keyboard);
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:118:20: error: expected ';' before 'bool'
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:119:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("selective", false);
^
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:119:20: error: expected ';' before 'bool'
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:122:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
buff.printTo(msg);
^
Multiple libraries were found for "SPI.h"
Used: /Users/rizkyakhbar/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/libraries/SPI
Multiple libraries were found for "MFRC522.h"
Used: /Users/rizkyakhbar/Documents/Arduino/libraries/MFRC522
Multiple libraries were found for "ESP8266WiFi.h"
Used: /Users/rizkyakhbar/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/libraries/ESP8266WiFi
Multiple libraries were found for "TelegramBot.h"
Used: /Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot
Multiple libraries were found for "ArduinoJson.h"
Used: /Users/rizkyakhbar/Documents/Arduino/libraries/ArduinoJson
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Used: /Users/rizkyakhbar/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/libraries/SPI
Multiple libraries were found for "MFRC522.h"
Used: /Users/rizkyakhbar/Documents/Arduino/libraries/MFRC522
Multiple libraries were found for "ESP8266WiFi.h"
Used: /Users/rizkyakhbar/Library/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/libraries/ESP8266WiFi
Multiple libraries were found for "TelegramBot.h"
Used: /Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot
Multiple libraries were found for "ArduinoJson.h"
Used: /Users/rizkyakhbar/Documents/Arduino/libraries/ArduinoJson
These have absolutely nothing to do with the compilation error. It's just some helpful information the Arduino IDE provides. Actually, in this case it's not so useful because there is a bug in Arduino IDE 1.8.10 that causes it to show "Multiple libraries were found" even when no multiple libraries were found. You'll know the legitimate "Multiple libraries were found" messages because they'll show the paths to multiple libraries. Generally, you can just ignore these messages. The only time you need to pay attention to them is if a different library than the one you intended was chosen.
To see the real cause of the error, you need to scroll the black console window up:
rizkyakhbar:
/Users/rizkyakhbar/Documents/Arduino/libraries/TelegramBot/src/TelegramBot.cpp:39:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
You can see the error is quite informative. However, you might find it easier to roll back to the version of the ArduinoJson library the code was written for, rather than porting the code to the ArduinoJson 6 API.
The ArduinoJson library 6.x.x versions have breaking changes that make them not work with code written for the ArduinoJson 5.x.x versions.
The recommended solution is to roll back to the newest 5.x.x release of ArduinoJson:
Sketch > Include Library > Manage Libraries...
Wait for the download to finish.
In the "Filter your search..." box, type "arduinojson".
In the search results, click on "ArduinoJson by Benoit Blanchon"
From the dropdown version menu, select "5.13.4".
Click "Install".
Wait for the installation to finish.
Click "Close'. The code should now compile.
The alternative solution is to update the code to work with the 6.x.x versions of ArduinoJson. You will find a guide to this here: