No such module 🍎 iOS

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

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

Seen on: iOS

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

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.