Xcode Build Error Analyzer
Parses and explains Xcode build failures, providing actionable guidance for fixing errors.
When to Use
- •User pastes build output containing errors
- •User asks "why did my build fail?"
- •User asks "what does this error mean?"
- •Build log contains compilation, linking, or signing errors
- •User shares
.xcresultbundle path
Usage
From Build Output
If the user pastes build output directly, first filter it to extract errors:
bash
echo "<pasted-output>" | swift ~/.claude/plugins/xcode-dx-skills/skills/xcode-log-filter/scripts/filter-log.swift
From Log File
bash
swift ~/.claude/plugins/xcode-dx-skills/skills/xcode-build-errors/scripts/parse-build-errors.swift /path/to/build.log
From xcresult Bundle
bash
swift ~/.claude/plugins/xcode-dx-skills/skills/xcode-build-errors/scripts/parse-build-errors.swift /path/to/Build.xcresult
Error Categories
The script categorizes errors to help with diagnosis:
| Category | Examples |
|---|---|
compiler | Type mismatches, missing imports, syntax errors |
linker | Undefined symbols, duplicate symbols, library not found |
signing | Provisioning profile issues, certificate problems |
resource | Missing assets, storyboard errors, Info.plist issues |
swift_type | Complex type inference failures, protocol conformance |
dependency | SPM resolution failures, framework embedding |
Analysis Approach
- •Parse errors using the script to get structured data
- •Group by category to identify patterns (e.g., "all linker errors")
- •Identify root cause - often the first error causes subsequent ones
- •Explain the error in plain terms
- •Suggest specific fixes with code examples when applicable
Common Error Patterns
Type Mismatch
code
Cannot convert value of type 'X' to expected argument type 'Y'
- •Check if types are compatible
- •Look for missing type conversions or casts
- •Consider if an optional needs unwrapping
Undefined Symbol
code
Undefined symbol: _OBJC_CLASS_$_SomeClass
- •Framework not linked - add to "Link Binary With Libraries"
- •Missing
-ObjClinker flag for static libraries - •SPM target not properly declared as dependency
Signing Issues
code
No signing certificate "iOS Development" found
- •Certificate not installed in Keychain
- •Provisioning profile expired or missing
- •Bundle identifier mismatch
Module Not Found
code
No such module 'SomeFramework'
- •SPM dependency not resolved - run
swift package resolve - •Framework search paths incorrect
- •Build order issue - dependency not built first
Output Format
The script outputs JSON with:
- •
errors: Array of errors with file, line, message, category - •
error_groups: Errors grouped by category - •
root_cause_candidates: Most likely root cause errors - •
fix_suggestions: Suggested fixes based on error patterns