Add Custom Library to Arduino15/packages

I had built a couple of custom libraries and just added them to Arduino15/packages/esp32/hardware/esp32/2.0.16/libraries/MyLib and all worked well. I moved to the now-depricated VSCode extension and am now moving back. Now the Arduino IDE 2.3.2 cannot find those libraries (it cannot find the header files and build stops) on my Windows machine. All is well on my Mac laptop.

I never "Installed" those libraries before. I did try putting the files in a zip and tried to add them from Sketch > Include Libraries > Add .ZIP Library and it results in an error "Error: 13 INTERNAL: Library install failed: archive is not valid: multiple files found in zip file top level".

I also tried adding my custom directories to subdirectories in the "Libraries" subdirectory of my sketch. It still cannot find the files.

Any help is very much appreciated.

1 Like

3rd party libraries don't belong in libraries directory of the core; they belong in the libraries directory of the sketchbook directory.

You can have a look at Library specification - Arduino CLI if you really want to create a correct library.

You can probably just make a directory in the libraries directory in the sketchbook directory (call it e.g. myLibrary) and place your library files in there. To my knowledge it can only be a single level, no sub directories; but I might be wrong with that.

1 Like

I managed to import the libraries into Arduino/Libraries so I'm good. I just don't know why it broke. I had added the libraries to core because it was a CellClient and CellClientSecure so I thought they belonged there as peers of WiFiClient.

Thanks for your prompt reply.

Maybe you updated the "esp32" boards platform. Everything you put into the platform installation folder will be lost every time you update the platform to a new version. Arduino IDE periodically checks to see if a new version of the installed platforms are available, and if so offers to update them for you. You might have clicked the update button in that notification without even realizing that it would affect your additions to the platform.

From this path:

I can see you have version 2.0.16 of the platform installed, while the latest version is 3.0.5. So you might well have received an update offer.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.