Skip to content

iOS build errorXcode: “No such module 'Name'”

An iOS build stops on an import line with No such module 'Firebase' (or Alamofire, Flutter, a pod or a Swift package). The compiler could not find that module for the target being built. Usually the dependency is not installed, not linked to this target, or Xcode opened the project file instead of the workspace.

Short answer

With CocoaPods (including Flutter and React Native apps), close Xcode, run pod install in the ios folder, and open the .xcworkspace, not the .xcodeproj. With Swift Package Manager, check the package is added to this target under General, Frameworks, Libraries, and Embedded Content, then use File, Packages, Reset Package Caches. If it fails only for one scheme or for tests, add the dependency to that target too. Clearing DerivedData fixes stale builds after the rest is right.

Why Xcode can’t find the module, and the fix

  1. 01

    The project file is open instead of the workspace

    “Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app.” CocoaPods, Using CocoaPods

    CocoaPods builds the pods into a workspace that contains your project and the Pods project. Opening the .xcodeproj builds your app without the pods, so every pod import fails. Close it and open the .xcworkspace.

    cd ios
    pod install
    open Runner.xcworkspace   # Flutter; App.xcworkspace or YourApp.xcworkspace elsewhere
  2. 02

    Pods or packages were never installed

    After cloning, switching branches or adding a Flutter or React Native package, the native dependencies must be installed again. Run flutter pub get or npm install first, then pod install in ios. For Swift packages, File, Packages, Resolve Package Versions.

    # Flutter (No such module 'Flutter' or a plugin)
    flutter clean && flutter pub get
    cd ios && rm -f Podfile.lock && pod install --repo-update
    
    # React Native
    npm install && cd ios && pod install
  3. 03

    The dependency is not linked to this target

    A Swift package or framework added to the app target is not visible to a widget, extension or test target. Add it to every target that imports it, or for pods, list the target in the Podfile.

    # Podfile
    target 'Runner' do
      pod 'Alamofire'
      target 'RunnerTests' do
        inherit! :search_paths
      end
    end
  4. 04

    Stale build data

    When everything is set up correctly and the error stays, clear the cached build: Product, Clean Build Folder, then delete DerivedData and build again.

    rm -rf ~/Library/Developer/Xcode/DerivedData

Checked against the vendor’s docs on : CocoaPods: Using CocoaPods (open the .xcworkspace).

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

Related: Flutter “pod install” failed · Xcode “Command PhaseScriptExecution failed” · Xcode “Signing requires a development team” · Xcode provisioning profile invalid or expired

Questions

More on this error

The app builds but the error shows in the editor. Is that a problem?

Not always. Xcode’s editor can show a stale error until the module is indexed. If the build succeeds, build once more or restart Xcode; if the build fails, follow the steps above.

It only fails on Apple Silicon or in the simulator. Why?

An old pod or framework may not include the architecture you are building for. Update the dependency first; excluding arm64 for the simulator is an old workaround that causes other problems.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.