My ZIP Library Will Not Import Into IDE

Windows 10
Arduino IDE 1.8.12

Was learning to create libraries and ran into an issue when using “Sketch…Include Library…Add .ZIP Library”

The library name is t_OS and here is the structure…
t_OS
t_OS\examples
t_OS\src
t_OS\keywords.txt
t_OS\library.properties
t_OS\examples\t_OS_Basic
t_OS\examples\t_OS_Basic\t_OS_Basic.ino
t_OS\src\t_OS.cpp
t_OS\src\t_OS.h

So to when I first created the ZIP file , I right-click on the directory t_OS, select Send To, then Compressed (zipped) folder.

Creating the t_OS.zip file using this method, the t_OS.zip will import successfully into the Arduino IDE.

I wanted to automate the process using a Windows powershell script.

I create another t_OS.zip using powershell and get the following error when importing into the Arduino IDE.

Any help would be appreciated.
Regards,
John


Arduino: 1.8.12 (Windows 10), Board: “SparkFun RedBoard Turbo”

Arduino Version: 1.8.12
java.io.FileNotFoundException: C:\Users\FLIGHT~1\AppData\Local\Temp\arduino_797132\t_OS154132\t_OS\examples (The system cannot find the path specified)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:162)
at processing.app.tools.ZipDeflater.deflate(ZipDeflater.java:50)
at processing.app.Base.handleAddLibrary(Base.java:2366)
at processing.app.Base$6.actionPerformed(Base.java:1114)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
at java.awt.Component.processMouseEvent(Component.java:6539)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
C:\Users\FLIGHT~1\AppData\Local\Temp\arduino_797132\t_OS154132\t_OS\examples (The system cannot find the path specified)

file1 t_OS.zip (1.9 KB)

file2 t_OS.zip (1.73 KB)

Found the issue but don't have a solution.

Using Ubuntu and the zipcmp command I get the following output

zipcmp file1/t_OS.zip file2/t_OS.zip
--- file1/t_OS.zip
+++ file2/t_OS.zip
-          0 00000000 t_OS/examples/
-          0 00000000 t_OS/examples/t_OS_Basic/
-        513 88b6335f t_OS/examples/t_OS_Basic/t_OS_Basic.ino
-        380 a7aef674 t_OS/keywords.txt
-        194 bee3e4a4 t_OS/library.properties
-          0 00000000 t_OS/src/
-       1085 3338c36d t_OS/src/t_OS.cpp

-        457 b1cbc86a t_OS/src/t_OS.h
+          0 00000000 t_OS\examples\
+        513 88b6335f t_OS\examples\t_OS_Basic\t_OS_Basic.ino
+        380 a7aef674 t_OS\keywords.txt
+        194 bee3e4a4 t_OS\library.properties
+       1085 3338c36d t_OS\src\t_OS.cpp
+        457 b1cbc86a t_OS\src\t_OS.h

[/code]

This explains why the Arduino IDE is generating the error above.

Question now is how to fix it?