arduino/Arduino · error · TargetPlatformException
No valid hardware definitions found in folder {0}.
Error message
No valid hardware definitions found in folder {0}. What it means
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).
Source
Thrown at arduino-core/src/processing/app/BaseNoGui.java:610
if (folders == null) {
return;
}
for (File subFolder : folders) {
if (!subFolder.exists() || !subFolder.canRead()) {
continue;
}
String arch = subFolder.getName();
try {
TargetPlatform p = new LegacyTargetPlatform(arch, subFolder, targetPackage);
targetPackage.getPlatforms().put(arch, p);
} catch (TargetPlatformException e) {
System.err.println(e.getMessage());
}
}
if (targetPackage.getPlatforms().size() == 0) {
throw new TargetPlatformException(I18n.format(tr("No valid hardware definitions found in folder {0}."), _folder.getName()));
}
}
/**
* Grab the contents of a file as a string.
*/
static public String loadFile(File file) throws IOException {
String[] contents = PApplet.loadStrings(file);
if (contents == null) return null;
return PApplet.join(contents, "\n");
}
public static void checkInstallationFolder() {
if (isIDEInstalledIntoSettingsFolder()) {
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);
}
if (isIDEInstalledIntoSketchbookFolder()) {
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);View on GitHub (pinned to a0df6e0e83)
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
Example fix
// before: wrong nesting hardware/mycore/boards.txt // missing architecture level // after: correct nesting hardware/mycore/avr/boards.txt hardware/mycore/avr/platform.txt
Defensive patterns
Strategy: validation
Validate before calling
File platform = new File(hwFolder, "<architecture>");
if (!new File(platform, "boards.txt").isFile())
throw new IllegalStateException("No boards.txt under " + hwFolder + " — wrong folder layout"); Try / catch
try {
BaseNoGui.loadHardware(hwFolder);
} catch (TargetPlatformException e) {
System.err.println("Reinstall the core: " + e.getMessage());
} Prevention
- 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
When it happens
Trigger: 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().
Common situations: 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.
Related errors
- Could not find tool {0} from package {1}
- Could not find tool {0}
- Board is not selected
- Tool {0} is not available for your operating system.
- Unable to understand proxy settings
AI-assisted analysis of arduino/Arduino@a0df6e0e83 (2026-09-06).
Data as JSON: /api/errors/e3546f9b1f5aa872.
Report an issue: GitHub.