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

Flutter iOS项目编译报错:未找到FirebaseCoreDiagnostics框架

解决方案:Framework not found FirebaseCoreDiagnostics 及 iOS部署版本兼容问题

1. 锁定Firebase相关Pod版本

在项目根目录的Podfile中,于target 'Runner' do代码块内添加版本锁定配置,避免版本冲突:

pod 'FirebaseCoreDiagnostics', '1.17.0'
pod 'FirebaseCore', '10.17.0'
pod 'FirebaseSharedSwift', '10.17.0'

执行以下命令更新Pods:

cd ios
pod deintegrate
pod install --repo-update

2. 统一iOS部署版本

  1. 打开Xcode,选中Runner项目,在General标签页的Deployment Info中,将iOS版本设置为14.0或更高(匹配Firebase最低兼容要求)。
  2. 修改Podfile顶部的部署版本声明:
platform :ios, '14.0'
  1. 重新执行pod install同步配置。

3. 深度清理缓存

除常规操作外,额外清理Xcode本地缓存:

flutter clean
rm -rf ~/Library/Developer/Xcode/DerivedData
cd ios
rm -rf Pods Podfile.lock Runner.xcworkspace
pod install
flutter pub get
flutter run

4. 统一Flutter Firebase插件版本

在pubspec.yaml中确保所有Firebase插件版本一致,示例配置:

dependencies:
  firebase_core: ^2.17.0
  firebase_auth: ^4.10.0
  cloud_firestore: ^4.10.0

执行flutter pub upgrade将插件更新至兼容版本。

5. 手动添加缺失框架(临时方案)

若以上方法无效,可手动导入框架:

  1. 打开Xcode的Runner项目,进入Build Phases -> Link Binary With Libraries。
  2. 点击+号,搜索FirebaseCoreDiagnostics,选择ios/Pods/FirebaseCoreDiagnostics目录下对应的.framework文件添加。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.13 02:30:50