{"record":{"id":"42eb34c85142540e","repo":"arduino/Arduino","slug":"missing-p-from-library","errorCode":null,"errorMessage":"'Missing '' + p + '' from library'","messagePattern":"'Missing '' \\+ p \\+ '' from library'","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"arduino-core/src/processing/app/packages/UserLibrary.java","lineNumber":97,"sourceCode":"    // Library sanity checks\n    // ---------------------\n\n    // Compatibility with 1.5 rev.1 libraries:\n    // \"email\" field changed to \"maintainer\"\n    if (!properties.containsKey(\"maintainer\") && properties.containsKey(\"email\")) {\n      properties.put(\"maintainer\", properties.get(\"email\"));\n    }\n\n    // Compatibility with 1.5 rev.1 libraries:\n    // \"arch\" folder no longer supported\n    File archFolder = new File(libFolder, \"arch\");\n    if (archFolder.isDirectory())\n      throw new IOException(\"'arch' folder is no longer supported! See http://goo.gl/gfFJzU for more information\");\n\n    // Check mandatory properties\n    for (String p : Constants.LIBRARY_MANDATORY_PROPERTIES)\n      if (!properties.containsKey(p))\n        throw new IOException(\"Missing '\" + p + \"' from library\");\n\n    // Check layout\n    LibraryLayout layout;\n    File srcFolder = new File(libFolder, \"src\");\n\n    if (srcFolder.exists() && srcFolder.isDirectory()) {\n      // Layout with a single \"src\" folder and recursive compilation\n      layout = LibraryLayout.RECURSIVE;\n    } else {\n      // Layout with source code on library's root and \"utility\" folders\n      layout = LibraryLayout.FLAT;\n    }\n\n    // Warn if root folder contains development leftovers\n    File[] files = libFolder.listFiles();\n    if (files == null) {\n      throw new IOException(\"Unable to list files of library in \" + libFolder);\n    }","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/arduino/Arduino/blob/a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee/arduino-core/src/processing/app/packages/UserLibrary.java#L79-L115","documentation":"UserLibrary.create() checks that library.properties declares every key in Constants.LIBRARY_MANDATORY_PROPERTIES (name, version, author, maintainer, sentence, paragraph etc.). If any mandatory property is absent from the parsed properties map, an IOException naming the missing key is thrown so the library cannot be loaded.","triggerScenarios":"Calling UserLibrary.create(libFolder) on a library whose library.properties (or.properties file for flat layouts) is missing one or more mandatory keys, or where the properties file could not be parsed into those keys.","commonSituations":"Hand-writing a library.properties and forgetting a required field like 'sentence' or 'maintainer'; converting a legacy library to 1.5 format with an incomplete manifest; corrupted or truncated library.properties after a bad download.","solutions":["Open <library>/library.properties and add the missing key reported in the message (name, version, author, maintainer, sentence, paragraph, url...)","Validate the manifest with the Arduino library-spec checklist or arduino-lint","Re-download/reinstall the library if library.properties was truncated or corrupted","Run the arduino-library-manager formatter (Arduino IDE: convert legacy library) to generate a complete library.properties"],"exampleFix":"// before\nname=MyLib\nversion=1.0.0\n// after (complete manifest)\nname=MyLib\nversion=1.0.0\nauthor=Jane Doe\nmaintainer=Jane Doe <jane@example.com>\nsentence=Does something useful.\nparagraph=Longer description.\nurl=https://example.com/mylib","handlingStrategy":"validation","validationCode":"Properties props = new Properties();\nprops.load(new FileInputStream(new File(libFolder, \"library.properties\")));\nfor (String p : Constants.LIBRARY_MANDATORY_PROPERTIES)\n  if (!props.containsKey(p)) throw new IllegalStateException(\"Missing \" + p);","typeGuard":null,"tryCatchPattern":"try {\n  UserLibrary lib = UserLibrary.create(libFolder);\n} catch (IOException e) {\n  if (e.getMessage().startsWith(\"Missing '\")) {\n    String key = e.getMessage().replace(\"Missing '\", \"\").replace(\"' from library\", \"\");\n    // append key to library.properties\n  }\n}","preventionTips":["Keep a template library.properties with all mandatory fields","Run arduino-lint or the IDE's library spec checker before publishing","Never hand-edit library.properties without re-validating it"],"tags":["arduino","library","metadata","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee","analyzedAt":"2026-09-06T10:13:38.901Z","contentChangedAt":"2026-09-06T10:13:38.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}