# Swift: No such module 'X' (module not found)

**Code:** `No such module` · **Category:** iOS · **Seen on:** iOS

Xcode can’t find a Swift package, pod or framework you import.

## Meaning

CocoaPods projects must be opened via .xcworkspace and built after pod install. Swift packages must be added to the target. Simulator/arch mismatches or a failed package resolution also cause it.

## Common causes

- Opened .xcodeproj instead of .xcworkspace (CocoaPods)
- pod install / package resolution not run or failed
- Framework not linked to this target
- Build settings excluding the architecture

## Quick fix

1. Open the .xcworkspace and run pod install
2. File → Packages → Reset Package Caches / Resolve Package Versions
3. Add the package/framework to the target’s Frameworks

## Detailed fix by platform

### Shell

1. 

```swift
pod install
open MyApp.xcworkspace
xcodebuild -resolvePackageDependencies
```


## How to diagnose

1. **Workspace** — Opened the right file?
2. **Target** — Package in Frameworks, Libraries?
3. **Logs** — Package resolution errors

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ios/no-such-module)
