ESP8266 "Multiple libraries were found for "AdafruitIO_WiFi.h"

:frowning: I am new with using the ESP8266 and Adafruit. I am trying to connect the ESP8266 with my Adafruit account but it gives the error:

“Multiple libraries were found for “AdafruitIO_WiFi.h”
Used: /Users/steph/Documents/Arduino/libraries/Adafruit_IO_Arduino
In file included from /Users/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/wifi/AdafruitIO_ESP8266.h:18:0,
Multiple libraries were found for “Adafruit_MQTT.h”
Used: /Users/steph/Documents/Arduino/libraries/Adafruit_MQTT_Library
from /UsersDocuments/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_WiFi.h:37,
from sketch/config.h:32,
from /var/folders/t1/_yj81zy540g7hjbh3ws457nr0000gn/T/arduino_modified_sketch_762781/adafruitio_00_publish.ino:18:
/Users/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO.h:23:31: fatal error: ArduinoHttpClient.h: No such file or directory
#include “ArduinoHttpClient.h”
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 mini Pro.”

I am not sure how to fix this problem or if there is a better way to do this, my final goal is to connect IFTTT to Adafruit and google home. I want to switch an LED on, first. Here is the final code from Adafruit:

"// Adafruit IO Publish Example
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//
// All text above must be included in any redistribution.

/************************** Configuration ***********************************/

// edit the config.h tab and enter your Adafruit IO credentials
// and any additional configuration needed for WiFi, cellular,
// or ethernet clients.
#include “config.h”

/************************ Example Starts Here *******************************/

// this int will hold the current count for our sketch
int count = 0;

// set up the ‘counter’ feed
AdafruitIO_Feed *counter = io.feed(“counter”);

void setup() {

// start the serial connection
Serial.begin(115200);

// wait for serial monitor to open
while(! Serial);

Serial.print(“Connecting to Adafruit IO”);

// connect to io.adafruit.com
io.connect();

// wait for a connection
while(io.status() < AIO_CONNECTED) {
Serial.print(".");
delay(500);
}

// we are connected
Serial.println();
Serial.println(io.statusText());

}

void loop() {

// io.run(); is required for all sketches.
// it should always be present at the top of your loop
// function. it keeps the client connected to
// io.adafruit.com, and processes any incoming data.
io.run();

// save count to the ‘counter’ feed on Adafruit IO
Serial.print("sending → ");
Serial.println(count);
counter->save(count);

// increment the count by 1
count++;

// Adafruit IO is rate limited for publishing, so a delay is required in
// between feed->save events. In this example, we will wait three seconds
// (1000 milliseconds == 1 second) during each loop.
delay(3000);

}
"

Here is the second attached code in the second tab:

"/************************ Adafruit IO Config *******************************/

// visit io.adafruit.com if you need to create an account,
// or if you need your Adafruit IO key.
#define IO_USERNAME “your_username”
#define IO_KEY “your_key”

/******************************* WIFI **************************************/

// the AdafruitIO_WiFi client will work with the following boards:
// - HUZZAH ESP8266 Breakout → https://www.adafruit.com/products/2471
// - Feather HUZZAH ESP8266 → https://www.adafruit.com/products/2821
// - Feather HUZZAH ESP32 → Adafruit HUZZAH32 – ESP32 Feather Board : ID 3405 : $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits
// - Feather M0 WiFi → https://www.adafruit.com/products/3010
// - Feather WICED → https://www.adafruit.com/products/3056
// - Adafruit PyPortal → Adafruit PyPortal - CircuitPython Powered Internet Display : ID 4116 : $54.95 : Adafruit Industries, Unique & fun DIY electronics and kits
// - Adafruit Metro M4 Express AirLift Lite → Adafruit Metro M4 Express AirLift (WiFi) - Lite : ID 4000 : $34.95 : Adafruit Industries, Unique & fun DIY electronics and kits
// - Adafruit AirLift Breakout → Adafruit AirLift – ESP32 WiFi Co-Processor Breakout Board : ID 4201 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
// - Adafruit AirLift Shield → Adafruit AirLift Shield - ESP32 WiFi Co-Processor : ID 4285 : $14.95 : Adafruit Industries, Unique & fun DIY electronics and kits
// - Adafruit AirLift FeatherWing → Adafruit AirLift FeatherWing – ESP32 WiFi Co-Processor : ID 4264 : $12.95 : Adafruit Industries, Unique & fun DIY electronics and kits

#define WIFI_SSID “your_ssid”
#define WIFI_PASS “your_pass”

// uncomment the following line if you are using airlift
// #define USE_AIRLIFT

// uncomment the following line if you are using winc1500
// #define USE_WINC1500

// comment out the following lines if you are using fona or ethernet
#include “AdafruitIO_WiFi.h”

#if defined(USE_AIRLIFT) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE)
// Configure the pins used for the ESP32 connection
#if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant
// Don’t change the names of these #define’s! they match the variant ones
#define SPIWIFI SPI
#define SPIWIFI_SS 10 // Chip select pin
#define NINA_ACK 9 // a.k.a BUSY or READY pin
#define NINA_RESETN 6 // Reset pin
#define NINA_GPIO0 -1 // Not connected
#endif
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS, NINA_ACK, NINA_RESETN, NINA_GPIO0, &SPIWIFI);
#else
AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#endif
/******************************* FONA **************************************/

// the AdafruitIO_FONA client will work with the following boards:
// - Feather 32u4 FONA → Adafruit Feather 32u4 FONA : ID 3027 : $44.95 : Adafruit Industries, Unique & fun DIY electronics and kits

// uncomment the following two lines for 32u4 FONA,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include “AdafruitIO_FONA.h”
// AdafruitIO_FONA io(IO_USERNAME, IO_KEY);

/**************************** ETHERNET ************************************/

// the AdafruitIO_Ethernet client will work with the following boards:
// - Ethernet FeatherWing → https://www.adafruit.com/products/3201

// uncomment the following two lines for ethernet,
// and comment out the AdafruitIO_WiFi client in the WIFI section
// #include “AdafruitIO_Ethernet.h”
// AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY);"

NB: These codes aren’t written by me, they are written by Adafruit.
Please help :confused:

Steve1062:

Multiple libraries were found for "AdafruitIO_WiFi.h"

Used: /Users/steph/Documents/Arduino/libraries/Adafruit_IO_Arduino
In file included from /Users/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/wifi/AdafruitIO_ESP8266.h:18:0,
Multiple libraries were found for "Adafruit_MQTT.h"



Used: /Users/steph/Documents/Arduino/libraries/Adafruit_MQTT_Library

This is just some helpful information the Arduino IDE provides (actually not helpful in Arduino IDE 1.8.10 due to a bug). It is a red herring distracting you from the real error. Just ignore it.

Steve1062:

                 from /UsersDocuments/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO_WiFi.h:37,

from sketch/config.h:32,
                from /var/folders/t1/_yj81zy540g7hjbh3ws457nr0000gn/T/arduino_modified_sketch_762781/adafruitio_00_publish.ino:18:
/Users/Documents/Arduino/libraries/Adafruit_IO_Arduino/src/AdafruitIO.h:23:31: fatal error: ArduinoHttpClient.h: No such file or directory
#include "ArduinoHttpClient.h"
                              ^

This is the real error.

When you see a "No such file or directory" error it almost always means you need to install the library that contains the missing file.

Often the code you're compiling will come with documentation (either a comment or separate document) that tells you where to get the library dependencies.

In other cases the author of the code will not have been so kind and you'll need to go on a hunt for the missing library.

A good place to start is the Arduino IDE's Library Manager:

  • Sketch > Include Library > Manage Libraries...
  • In the "Filter your search..." box, type some keywords you have gleaned from the missing file name.
  • Scroll through the results for the right library. Click on it.
  • Click "Install".
  • Wait for installation to finish.
  • Click "Close".
  • Try compiling your code again.

If you have no luck in Library Manager then load up your favorite search engine and do a search for the missing filename. You will often get multiple results. If you have a lot of results you might add "arduino" as an additional search keyword. I will usually prefer results on github.com since that is where most Arduino libraries are hosted and downloading from there is fast and easy. In some cases there will be multiple libraries that contain the given filename and you'll need to do some evaluation to determine which seems the most appropriate, then try it out. After downloading the library you found you'll need to install it. This requires a different process than the Library Manager installation. You will find instructions here:

I also have this problem and have a very simple example that shows the Arduino bug.
There is just one library Streaming installed here, on:
D:\Albert\Documents\Arduino\libraries
I searched well on my PC and there is nowhere a second Streaming lib present.

This is the very simple sketch:

#include <Streaming.h>

void setup()
{ m
}

void loop()
{
}

I
The error Multiple libraries were found for “Streaming.h” is shown
If I delete the m, the result is: compiling done, no further messages

See my answer in your bug report: