Could not find dependency

Hi all, I’m posting this here because I don’t know if it’s a bug or not.

I’m trying to use the Homie library. I installed Homie using the library manager and it found the dependencies: ArduinoJson, Bounce2, PubSubClient. So now I have all 4 libraries installed. However when I go to compile a program with Homie, I get this error:

Error: Could not find `Json` dependency for `Homie` library

But there is no Json dependency, only ArduinoJson, which I have. So where is it getting this idea that I need a library called Json?

When did you installed this library? The Json library was renamed to ArduinoJson. Please uninstall current libraries and try again. See my log

pio lib -g install Homie
Library Storage: /Users/ikravets/.platformio/lib
Looking for Homie library in registry
Found: http://platformio.org/lib/show/555/Homie
LibraryManager: Installing id=555
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Homie @ 1.5.0 has been successfully installed!
Installing dependencies
Looking for ArduinoJson library in registry
Found: http://platformio.org/lib/show/64/ArduinoJson
LibraryManager: Installing id=64
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
ArduinoJson @ 5.6.6 has been successfully installed!
Looking for PubSubClient library in registry
Found: http://platformio.org/lib/show/89/PubSubClient
LibraryManager: Installing id=89
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
PubSubClient @ 2.6 has been successfully installed!
Looking for Bounce2 library in registry
Found: http://platformio.org/lib/show/1106/Bounce2
LibraryManager: Installing id=1106
Downloading  [####################################]  100%
Unpacking  [####################################]  100%
Bounce2 @ 2.1 has been successfully installed!

No that’s the thing, I don’t have any libraries called Json. At least, I don’t remember installing one, and it doesn’t appear when I type pio lib list. All I’ve done is install Homie, like you have above, but I can’t compile my script. Test it with a file that only has one line: #include <Homie.h>.

Some more information… I tried compiling scripts that just have a single include line. This is the results from each test, run one at a time:

#include <Arduino.h>  //this works (aside from the expected error about lacking setup() and loop())
#include <Homie.h>    //Error: Could not find `Json` dependency for `Homie` library
#include <Bounce2.h> //Error: Could not find `Json` dependency for `Homie` library
#include <ESP8266WebServer.h> //Error: Could not find `Json` dependency for `Homie` library

So hang on, why is it complaining about the Homie library when I’m not including it?

I just created an entirely new project in a new folder and the problem persists… so I can’t use any third-party libraries now.

Fixed! I uninstalled Homie, and then reinstalled it with the -g option. Now everything compiles properly again :slight_smile:

See my comment above

I asked you to reinstall library :slight_smile:

Happy Coding with PlatformIO!

Yeah I see, I just didn’t get the important of the -g flag. In both cases I got the same successful-install messages, but I just couldn’t compile anything unless the -g flag was used.

Sorry, something is wrong with your project. -g means install to global storage. looks like you have other storages. Please read the docs and check where you have obsolete Homie library. Remove it manually with system file manager.

I’m having a similar issue on a brand new Windows 8 virtual machine with clean installs of everything.

"Error: Could not findArduinoJsondependency forHomielibrary"

Please run pio update and then install a library.

It turned out to be a problem with the Homie library on the develop branch.

Hi i change to PlatformIO and when I build Homie I get this error.

from .piolibdeps\ArduinoJson_ID64/include/ArduinoJson/JsonBufferBase.hpp:10,
from .piolibdeps\ArduinoJson_ID64/include/ArduinoJson/DynamicJsonBuffer.hpp:10,
from .piolibdeps\ArduinoJson_ID64/include/ArduinoJson.hpp:10,
from .piolibdeps\ArduinoJson_ID64/include/ArduinoJson.h:8,
from .piolibdeps\ArduinoJson_ID64/ArduinoJson.h:8,
from .piolibdeps\Homie_ID555\src\Homie\Datatypes/../Limits.hpp:3,
from .piolibdeps\Homie_ID555\src\Homie\Datatypes/Interface.hpp:3,

from .piolibdeps\Homie_ID555\src\Homie\Blinker.hpp:4,
from .piolibdeps\Homie_ID555\src\Homie\Blinker.cpp:1:
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:19:5: error: 'Stream' does not name a type
Stream& _stream;
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:22:20: error: expected ')' before '&' token
Iterator(Stream& stream) : _stream(stream) {}
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp: In member function 'char ArduinoJson::Internals::StdStreamFuncs::Iterator::next
()':
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:25:15: error: '_stream' was not declared in this scope
int n = _stream.read();
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp: At global scope:
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:35:24: error: 'Stream' was not declared in this scope
Stream, typename TypeTraits::RemoveReference<
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:36:50: error: template argument 1 is invalid
TStream>::type>::value>::type>
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:36:58: error: template argument 1 is invalid
TStream>::type>::value>::type>
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:37:5: error: expected '::' before ':' token
: StdStreamFuncs {};
^
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:37:5: error: expected identifier before ':' token
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:37:5: error: qualified name does not name a class before ':' token
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:37:5: error: expected '{' before ':' token
.piolibdeps\ArduinoJson_ID64/include/ArduinoJson/Deserialization/../Serialization/../StringTraits/
ArduinoStream.hpp:37:5: error: expected unqualified-id before ':' token
Compiling .pioenvs\esp01_1m\lib\Homie_ID555\Homie\Boot\BootConfig.o
*** [.pioenvs\esp01_1m\lib\Homie_ID555\Homie\Blinker.o] Error 1
 [ERROR] Took 9.38 seconds

It looks that you are going to use C++ code in *.c file instead of *.cpp.