Local Library import error "Could not find the package with 'lib/Display' requirements for your system 'windows_amd64'"

Hey all, new to PlatformIO and ESP32 development.

I’m setting up my projects in the following way:

PlatformIO (dir)
----lib (dir)
----Project1 (dir)

In Project1’s platformio.ini file I define ‘lib_extra_dirs = …/lib’. After rebuilding IntelliSense, the libraries appear in the c_cpp_properties.json file, cool!

Now, I’m trying to add the local library “Display” to my project but getting the error:

Warning! Could not find the package with 'lib/Display' requirements for your system 'windows_amd64'

I’m guessing this has something to do with my library.json file, but cant figure it out.

Library.json:

{

    "name": "Display",

    "version": "1.0.0",

    "description": "Simple wrapper for display",

    "keywords": "display, easy, simple, ez",

    "authors":

    [

      {

        "name": "blah",

        "email": "blah@gmail.com",

        "maintainer": true

      }

    ],

    "license": "MIT",

   "dependencies": [
     {
   "name": "olikraus/U8g2",
   "version": "^2.28.8"
     }
   ],
   "frameworks": "*",
   "platforms": "*",
   "architectures": "*"

  }

Thanks!!

If there is a library Display in the lib/ folder, refer to it just by name, not by path. lib_deps = Display suffices. It may also suffice to declare it not at all because PlatformIO’s library dependency manager should find it automatically in this case.

Otherwise, show the whole platformio.ini.

I dont want it in the local projects lib directory. I’d like it to be outside of the local project. For example, I would like Project1 to be able to access the libraries in “Local Libraries” below.

– Local Libraries
---- Display
– Project1

Then use lib_extra_dirs = ../Local Libraries and reference the lib via lib_deps = Display (which should be optional since it will probably be picked up by the LDF automatically).

My original post says exactly what you are requesting but it doesn’t work.

And as said above, refering to the lib via lib_deps = lib/Display is wrong because this is the owner/libraryname syntax used for pulling libraries from the PlatformIO library registry.

Full platformio.ini?

Give me a bit to create something on github :slight_smile: Is there a “codepen project” like “disposable” project thinger for platformio?

Uploading everything in the current folder structure to Github will do it.