# Xcode: Module 'firebase_core' not found — flutter build ios fails after adding a plugin

**Code:** `Module 'x' not found (iOS build)` · **Category:** Flutter / Dart · **Seen on:** Flutter, iOS

The iOS project cannot find a CocoaPods module, usually because Pods are missing, outdated, or the workspace was not used.

## Meaning

After adding plugins run `pod install` in `ios/`, open `Runner.xcworkspace` (not .xcodeproj), and clean stale artifacts. On Apple Silicon, mismatched architectures or an old `Podfile.lock` can also trigger this.

## Common causes

- `pod install` not run after `pub get`
- Opening Runner.xcodeproj instead of the workspace
- Stale Pods/Podfile.lock
- Deployment target lower than the plugin requires
- Architecture mismatch on Apple Silicon

## Quick fix

1. `flutter clean && flutter pub get && cd ios && pod install --repo-update`
2. Open `Runner.xcworkspace`
3. Raise the iOS deployment target in the Podfile

## Detailed fix by platform

### Flutter

1. `cd ios && rm -rf Pods Podfile.lock && pod install --repo-update`

## How to diagnose

1. **Workspace** — Using .xcworkspace?
2. **Pods** — Installed?
3. **Target** — iOS version high enough?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/flutter/flutter-clean-pods-module-not-found)
