# Fix Build

> Diagnose and fix build errors in the iOS project. Use when the build fails and you need to identify and resolve compilation issues.

- Skill: `duboc/fix-build` (Agent Skill)
- Install (CLI): `npx skillmds@latest add duboc/fix-build`
- Raw SKILL.md: https://api.skillmd.com/api/skills/duboc/fix-build/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: duboc (https://skillmd.com/u/duboc)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/duboc/fix-build

---


# Fix Build Errors

Systematically diagnose and fix iOS build errors.

## Workflow

### 1. Get Fresh Build Output
```bash
# Clean build to get all errors
xcodebuild clean build \
  -scheme MyApp \
  -destination 'platform=iOS Simulator,name=iPhone 15' \
  2>&1 | tee build_output.txt
```

### 2. Analyze Errors

Parse the build output for:
- Compilation errors (error:)
- Linker errors (ld:)
- Swift errors (Swift Compiler Error)
- Missing dependencies

### 3. Categorize Issues

#### Syntax Errors
- Missing brackets, semicolons
- Typos in code
- Invalid Swift syntax

#### Type Errors
- Type mismatch
- Missing protocol conformance
- Generic constraint violations

#### Import Errors
- Missing imports
- Circular dependencies
- Module not found

#### Concurrency Errors
- Sendable violations
- Actor isolation issues
- Data race warnings

#### Linker Errors
- Duplicate symbols
- Missing libraries
- Architecture mismatches

### 4. Fix Strategy

Think deeply about each error:
1. What is the root cause?
2. What is the minimal fix?
3. Are there related errors that will resolve together?

### 5. Implement Fixes

Fix one category at a time:
1. Fix import/module errors first
2. Fix type errors
3. Fix syntax errors
4. Fix concurrency errors
5. Rebuild after each category

### 6. Verify Fix
```bash
xcodebuild build \
  -scheme MyApp \
  -destination 'platform=iOS Simulator,name=iPhone 15'
```

## Common Fixes

### Missing Sendable Conformance
```swift
// Add @unchecked Sendable for legacy types
extension LegacyType: @unchecked Sendable {}

// Or make type properly Sendable
struct MyType: Sendable {
    let value: String  // All properties must be Sendable
}
```

### Actor Isolation
```swift
// Add MainActor annotation
@MainActor
final class ViewModel { }

// Or use nonisolated for non-UI methods
nonisolated func computeValue() -> Int { }
```

### Generic Constraints
```swift
// Add missing protocol conformance
struct Item: Identifiable, Hashable {
    let id: UUID
}
```

