platformio-core icon indicating copy to clipboard operation
platformio-core copied to clipboard

Library dependencies are installed but not available during build (PlatformIO)

Open DereIBims opened this issue 9 months ago • 1 comments

Hi,

I’m not sure whether this is an issue with my library or with the PlatformIO core, but something seems off with dependency handling.

In my platformio.ini I added:

lib_deps = dereibims/HomeAssistantManager@^1.0.2

PlatformIO reports that the library’s dependencies (ArduinoJson, PubSubClient, and ArduinoLog) are being installed. During the build, it again shows messages about installing these dependencies and then continues compiling.

Image

However, the build fails because none of those dependencies can be found by the compiler (missing includes / headers not found).

Image

From my understanding, dependencies declared in the library should be available automatically without having to add them manually to lib_deps in the project.

Is this expected behavior, or is there something wrong with how PlatformIO resolves library dependencies here?

Thanks!

DereIBims avatar Feb 05 '26 20:02 DereIBims

We added a workaround in the upcoming PIO Core 6.2.0 for the mistakes in library.json.

See docs https://docs.platformio.org/en/latest/manifests/library-json/fields/dependencies.html and how did you configured dependencies https://github.com/DereIBims/HomeAssistantManager/blob/release/library.json#L27

This is wrong:

    {
      "name": "knolleary/PubSubClient",
      "version": "^2.8"
    },

you have to fix these issues as :

    {
      "owner": "knolleary",
      "name": "PubSubClient",
      "version": "^2.8"
    },

or (recommended)

"dependencies": {
   "knolleary/PubSubClient": "^2.8",
   "...."
}

ivankravets avatar Sep 05 '26 13:09 ivankravets