You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Flutter升级后cloud_firestore包导致iOS构建失败

Fixing Cloud Firestore Build Failures After Flutter Upgrade (iOS)

Hey there, let’s work through this frustrating build issue you’re facing after upgrading Flutter. When cloud_firestore breaks your iOS build but removing it fixes things, it’s almost always related to dependency conflicts, outdated caches, or misconfigured iOS project settings. Here are the step-by-step fixes that usually resolve this:

1. Full Cache & Pod Cleanup

Stale caches and outdated Pods are the #1 culprit here—let’s wipe them and start fresh:

  • Navigate to your project’s iOS directory: cd ios
  • Delete the Pod lock file and Pods folder:
    rm Podfile.lock
    rm -rf Pods
    
  • Head back to the project root: cd ..
  • Clear Flutter’s build cache: flutter clean
  • Re-fetch your Dart dependencies: flutter pub get
  • Reinstall Pods with repo updates (critical to pull the latest Firebase versions):
    cd ios && pod install --repo-update
    

2. Verify Firebase Configuration File

Double-check that your GoogleService-Info.plist is set up correctly:

  • Make sure it’s placed in the ios/Runner directory
  • Important: Add it to your Xcode project by right-clicking the Runner folder in Xcode and selecting "Add Files to Runner"—don’t just drag it into Finder, as this can cause hidden path issues.

3. Update Podfile Settings

Flutter upgrades sometimes require adjustments to your iOS Podfile:

  • Open ios/Podfile and ensure the platform version meets Firebase’s minimum requirement:
    platform :ios, '13.0'
    
  • If you’re using other Firebase plugins, add the static linkage flag for frameworks (this fixes many compatibility conflicts):
    target 'Runner' do
      use_frameworks! :linkage => :static
      use_modular_headers!
      # ... rest of your Podfile code
    end
    

4. Sync Firebase Dependency Versions

Outdated or mismatched Firebase plugin versions can break builds:

  • Run flutter pub upgrade cloud_firestore to pull the latest compatible version of the plugin
  • Check your pubspec.yaml to ensure all Firebase plugins (like firebase_core) are on versions that work with your upgraded Flutter SDK

5. Xcode Project Sanity Checks

Open your project in Xcode (use Runner.xcworkspace, not Runner.xcodeproj) and verify these settings:

  • Go to Build Settings > Deployment Target and confirm it’s set to iOS 13.0 or higher
  • Check Signing & Capabilities to ensure Cloud Firestore is listed (most plugins add this automatically, but it’s worth verifying)

If none of these steps work, try deleting and re-installing your Flutter SDK to ensure you have a clean, up-to-date environment.

内容的提问来源于stack exchange,提问作者Travis Baksh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 08:04:20