Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options


🧩 Problem Description

I am attempting to build a project written with Flutter 3.35 (stable) for iOS 18, and run it using the iOS Simulator.

The Xcode build completes successfully, but the subsequent simulator build fails with the following error:

Failed to build iOS app
Parse Issue (Xcode): Module 'cloud_firestore' not found
/Users/mwp/Documents/wellness/ios/Runner/GeneratedPluginRegistrant.m:11:8

Could not build the application for the simulator.
Error launching application on Emulator.

📁 Environment

  • Flutter version: 3.35.0 (stable)
  • Dart version: 3.10.0
  • Xcode version: 9.3
  • CocoaPods version: 1.15.2
  • iOS version (simulator): 18.0
  • Device: iPhone 16 Pro Simulator

📜 Podfile

# Uncomment this line to define a global platform for your project
platform :ios, '16.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
        '$(inherited)',
        'PERMISSION_CAMERA=1',
        'PERMISSION_PHOTOS=1',
        'PERMISSION_MICROPHONE=1',
        'PERMISSION_NOTIFICATIONS=1',
      ]
    end
  end
end

🧠 What I’ve Tried

  • Ran pod deintegrate && pod install inside the ios/ directory

  • Cleaned the Flutter build:

    flutter clean
    flutter pub get
    
  • Rebuilt pods using:

    pod repo update
    pod install
    
  • Verified that cloud_firestore is correctly declared in pubspec.yaml


🆘 Question

Could you please help identify:

  1. The cause of this “Module ‘cloud_firestore’ not found” error during simulator build, and
  2. The recommended steps to resolve it when targeting iOS 18 with Flutter 3.35.

📸 Screenshots

image
You must be logged in to vote

Replies: 2 comments

Comment options

Short version: your toolchain is mismatched. You’re trying to run an iOS 18 simulator with Xcode 9.3—that can’t work. The “Module ‘cloud_firestore’ not found” is a side-effect of the wrong SDK/Pods build, not the real root cause.

Fix (do these in order)

Upgrade Xcode

Install Xcode 16.x (required for iOS 18 simulators).

xcode-select --switch /Applications/Xcode.app

Open Xcode once → accept license → install iOS 18 simulators.

Clean CocoaPods/Flutter artifacts

rm -rf ios/Pods ios/Podfile.lock ios/Runner.xcworkspace
flutter clean
flutter pub get
cd ios
pod repo update
pod install

Simplify your Podfile

Remove use_modular_headers! (it often breaks Firebase imports).

Prefer static frameworks (Firebase-friendly):

target 'Runner' do
use_frameworks! :linkage => :static
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
target 'RunnerTests' do
inherit! :search_paths
end
end

Keep your platform :ios, '16.0' and your post_install block.

Open the correct workspace & build for simulator

Open ios/Runner.xcworkspace (not the .xcodeproj).

Select an iOS 18 simulator (e.g., iPhone 16 Pro) and build.

If you hit arch errors on Apple Silicon (only if needed)
Add in post_install:

config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'

Then pod install again.

Verify package versions

Make sure cloud_firestore is up to date and compatible with Flutter 3.35:

flutter pub outdated cloud_firestore

If you use Firebase, ensure your iOS setup is complete (GoogleService-Info.plist present, flutterfire configure if applicable).

You must be logged in to vote
0 replies
Comment options

The most likely fix is that the simulator build is still using Xcode 9.3 under the hood even if you installed newer tools. That produces pods compiled against the wrong SDK and the compiler cannot find the cloud_firestore module. Point the command line tools to the current Xcode, clear DerivedData and pods, then rebuild so everything targets the iOS 18 simulator SDK.

Open a terminal and run this exactly

set -euo pipefail
xcode-select --switch /Applications/Xcode.app
xcodebuild -version
xcrun --sdk iphonesimulator --show-sdk-version
rm -rf ~/Library/Developer/Xcode/DerivedData
cd ios
rm -rf Pods Podfile.lock Runner.xcworkspace .symlinks
cd ..
flutter clean
flutter pub get
cd ios
pod repo update
pod install
cd ..
open ios/Runner.xcworkspace

This switches the active Xcode, verifies versions, deletes stale build outputs, recreates Pods, and opens the correct workspace.

After that, build for an iOS 18 simulator from Xcode. If it compiles and runs, the toolchain mismatch was the cause.

If it still fails, regenerate the iOS project files so they match Flutter 3.35 templates, then re-add your Firebase plist and settings:

flutter create .
cd ios
pod install
open Runner.xcworkspace

If this solved your problem, please mark the answer as helpful so others can find it easily.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.