chof747
chof747

Reputation: 26

Can not declare dependency to bblanchon/ArduinoJson in my library.json (platform io)

I am creating a platform IO library for one of my projects, which depends on ArduinoJson from bblanchon.

I have declared the dependency in my library.json file (both with the name as well as with the git repository as reference - see below). But when I try to compile a project that is using my library, the ArduinoJson library is not added to the dependency tree and compiling fails as the header file ArduinoJson.h is not found.

If I add the ArduinoJson as a dependency to the platformio.ini it is added to the dependency tree and the software compiles without issues. However this is not a clean solution and I want to now how I should declare the dependency in my library so that I do not have to add ArduinoJson to every project I build with this library.

Do you have any ideas how I can make this work?

Thx Christian

Declaration of dependency as suggested by pio library finder:

"dependencies" : 
{
    ...
    "bblanchon/ArduinoJson" : "*"
}

As reference to the repository

"dependencies" : 
{
    ...
    "bblanchon/ArduinoJson" : "https://github.com/bblanchon/ArduinoJson.git"
}

Upvotes: 0

Views: 747

Answers (1)

RunningDad
RunningDad

Reputation: 11

This one had me going for a bit as well. Here are the steps I took to solve.

  1. Add to platformio.ini: lib_deps = Arduino-libraries/Arduino_JSON @ 0.1.0

  2. Verify that you have the folder /.pio/libdeps/Arduino_JSON

  3. Use #include <Arduino_JSON> in you code.

Upvotes: 1

Related Questions