{"record":{"id":"e3546f9b1f5aa872","repo":"arduino/Arduino","slug":"no-valid-hardware-definitions-found-in-folder-0","errorCode":null,"errorMessage":"No valid hardware definitions found in folder {0}.","messagePattern":"No valid hardware definitions found in folder (.+?)\\.","errorType":"exception","errorClass":"TargetPlatformException","httpStatus":null,"severity":"error","filePath":"arduino-core/src/processing/app/BaseNoGui.java","lineNumber":610,"sourceCode":"    if (folders == null) {\n      return;\n    }\n\n    for (File subFolder : folders) {\n      if (!subFolder.exists() || !subFolder.canRead()) {\n        continue;\n      }\n      String arch = subFolder.getName();\n      try {\n        TargetPlatform p = new LegacyTargetPlatform(arch, subFolder, targetPackage);\n        targetPackage.getPlatforms().put(arch, p);\n      } catch (TargetPlatformException e) {\n        System.err.println(e.getMessage());\n      }\n    }\n\n    if (targetPackage.getPlatforms().size() == 0) {\n      throw new TargetPlatformException(I18n.format(tr(\"No valid hardware definitions found in folder {0}.\"), _folder.getName()));\n    }\n  }\n\n  /**\n   * Grab the contents of a file as a string.\n   */\n  static public String loadFile(File file) throws IOException {\n    String[] contents = PApplet.loadStrings(file);\n    if (contents == null) return null;\n    return PApplet.join(contents, \"\\n\");\n  }\n\n  public static void checkInstallationFolder() {\n    if (isIDEInstalledIntoSettingsFolder()) {\n      showError(tr(\"Incorrect IDE installation folder\"), tr(\"Your copy of the IDE is installed in a subfolder of your settings folder.\\nPlease move the IDE to another folder.\"), 10);\n    }\n    if (isIDEInstalledIntoSketchbookFolder()) {\n      showError(tr(\"Incorrect IDE installation folder\"), tr(\"Your copy of the IDE is installed in a subfolder of your sketchbook.\\nPlease move the IDE to another folder.\"), 10);","sourceCodeStart":592,"sourceCodeEnd":628,"githubUrl":"https://github.com/arduino/Arduino/blob/a0df6e0e83b652c72bc78b0a1376c54d6ebc3bee/arduino-core/src/processing/app/BaseNoGui.java#L592-L628","documentation":"BaseNoGui throws TargetPlatformException when, after loading a hardware package's folders, no valid platforms were found inside the package. It means the folder layout does not match the expected Arduino hardware hierarchy (e.g. missing <architecture> subfolders with boards.txt/platform.txt).","triggerScenarios":"loadHardware() processes a folder under the hardware directory; all subfolder load attempts either failed (TargetPlatformException caught and printed) or yielded zero entries in targetPackage.getPlatforms().","commonSituations":"Manually downloading a core and extracting one level too deep or too shallow; renaming architecture folders; a boards.txt missing from the platform folder; corrupt/incomplete IDE installation.","solutions":["Verify the hardware folder layout: <hardware-path>/<vendor>/<architecture>/{boards.txt,platform.txt} and re-extract the core if wrong","Check the console output just above the error for TargetPlatformException details about the rejected folders","Reinstall/repair the affected core via Boards Manager (or delete and re-download the vendor folder)","Ensure the folder actually contains boards.txt; if this is your own package, add a valid platform.txt/boards.txt pair"],"exampleFix":"// before: wrong nesting\nhardware/mycore/boards.txt          // missing architecture level\n// after: correct nesting\nhardware/mycore/avr/boards.txt\nhardware/mycore/avr/platform.txt","handlingStrategy":"validation","validationCode":"File platform = new File(hwFolder, \"<architecture>\");\nif (!new File(platform, \"boards.txt\").isFile())\n  throw new IllegalStateException(\"No boards.txt under \" + hwFolder + \" — wrong folder layout\");","typeGuard":null,"tryCatchPattern":"try {\n  BaseNoGui.loadHardware(hwFolder);\n} catch (TargetPlatformException e) {\n  System.err.println(\"Reinstall the core: \" + e.getMessage());\n}","preventionTips":["Install cores via Boards Manager instead of manual extraction","Keep the <vendor>/<architecture>/boards.txt directory hierarchy intact","Check IDE console output above the error for the specific rejected folder","After manual installs, confirm boards.txt exists one level below the vendor folder"],"tags":["hardware","configuration","boards","platform"],"backgroundTag":"directory-not-found","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"}