Skip to content

Flutter iOS build errorFlutter: “‘Flutter/Flutter.h’ file not found” (Xcode)

An iOS build stops in Xcode with ‘Flutter/Flutter.h’ file not found, usually in GeneratedPluginRegistrant.h or a plugin’s header. Xcode can’t see the Flutter framework: the project was opened without its pods, the generated iOS files are missing or stale, or the Podfile is from an older Flutter template.

Short answer

Close Xcode. In the project folder run flutter clean, flutter pub get, then cd ios and pod install. Open ios/Runner.xcworkspace, not Runner.xcodeproj, and build again. If it still fails after a Flutter upgrade, compare your ios/Podfile with a fresh flutter create project and restore the flutter_install_all_ios_pods lines.

Why Xcode can’t find Flutter.h, and the fix

  1. 01

    Xcode opened the .xcodeproj instead of the workspace

    “Open the default Xcode workspace in your project by running open ios/Runner.xcworkspace in a terminal window from your Flutter project directory.” Flutter, Build and release an iOS app

    Runner.xcodeproj builds the app without the Pods project, so Flutter and every plugin header go missing. Close it and open the workspace, from the terminal or by double-clicking Runner.xcworkspace.

    open ios/Runner.xcworkspace
  2. 02

    The generated files and pods are missing or stale

    “To support Flutter plugins that use native iOS or macOS code, install the latest version of CocoaPods.” Flutter, Set up iOS development

    A fresh clone, a branch switch or a Flutter upgrade leaves ios/Flutter/Generated.xcconfig and the Pods folder out of date. Building from Xcode first doesn’t create them; the flutter tool does. Regenerate both, then build.

    flutter precache --ios
    flutter clean
    flutter pub get
    cd ios
    pod install --repo-update
    cd ..
    flutter build ios --debug --no-codesign
  3. 03

    The Podfile is from an older Flutter template

    Older Podfiles wired up the Flutter pod and plugins with custom Ruby. Current templates call flutter_install_all_ios_pods inside the Runner target, plus flutter_additional_ios_build_settings in post_install. Create a throwaway project with the same Flutter version and copy its Podfile structure, keeping your platform line and any extra pods.

    flutter create /tmp/podfile_ref
    diff ios/Podfile /tmp/podfile_ref/ios/Podfile
  4. 04

    A pod-based project was reopened outside the workspace on CI

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

    A CI step that calls xcodebuild with -project instead of -workspace hits the same missing header. Point it at the workspace, or let flutter build ipa run xcodebuild for you.

    xcodebuild -workspace ios/Runner.xcworkspace -scheme Runner -configuration Release archive

Checked against the vendor’s docs on : Flutter: Build and release an iOS app; Flutter: Set up iOS development (CocoaPods); 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 “No such module” · Xcode PhaseScriptExecution failed · flutter: command not found

Questions

More on this error

Does deleting Podfile.lock help?

Sometimes, when a plugin upgrade left pods pinned to old versions. Delete ios/Podfile.lock and ios/Pods, run pod install --repo-update, and commit the new Podfile.lock so every machine and CI gets the same pods.

The error appeared after I moved to Swift Package Manager. Why?

Plugins that support Swift Package Manager and plugins that still need CocoaPods can be mixed in one app. Run flutter clean and flutter pub get so Flutter regenerates both, then pod install if a Podfile is still there.

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.