Repository navigation
LIBRARY_JSON_FIX
github-actions[bot] edited this page Oct 16, 2025
·
1 revision
PlatformIO SCons build system was failing with path resolution errors when building projects that depend on AlteriomPainlessMesh library.
The library.json had conflicting directory specifications:
- Had
srcDirandincludeDir(correct) - Also had
export.include(conflicting)
When both are present, PlatformIO's SCons build system gets confused about which directory specification to use, leading to path resolution failures.
{
"srcDir": "src",
"includeDir": "src",
"export": {
"include": "src"
}
}{
"srcDir": "src",
"includeDir": "src"
}Change: Removed the export.include section entirely.
-
srcDirtells PlatformIO where source files (.cpp) are located -
includeDirtells PlatformIO where header files (.h) are located -
export.includeis an older/alternative way to specify include paths
Having both causes PlatformIO to:
- Try to resolve paths twice
- Get conflicting information
- Fail with "UnboundLocalError: dir" in SCons
Run the validation script:
python scripts/validate_library_structure.pyResult: ✅ 8/8 checks passed
If you were experiencing build errors:
-
Clean your build cache:
pio run --target clean rm -rf .pio
-
Pull latest library:
pio pkg update
-
Rebuild:
pio run
-
library.json- Removedexport.includesection - Created
SCONS_BUILD_FIX.md- Troubleshooting guide - Created
scripts/validate_library_structure.py- Validation tool
Tested with:
- ✅ validation script passes
- ✅ JSON structure valid
- ✅ All required fields present
- ✅ No conflicting directory specifications
October 15, 2025
✅ FIXED - Ready for use in PlatformIO projects