未找到文件 Flutter/Flutter.h

时间:2021-06-16 08:11:33

标签: firebase flutter flutter-dependencies crashlytics

将 firebase_crashlytics 添加到项目后,我不断收到未找到 Flutter/Flutter.h 文件的问题。 颤振 SDK:2.2.2 firebase_crashlytics:^2.0.6 我已经尝试了很多来自 stackoverflow 的解决方案,但仍然无法为 ios 运行。

2 个答案:

答案 0 :(得分:2)

唯一对我有用的解决方案被放弃了。 在我的 podfile 中更改这些行可以解决问题

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'YES'
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
    end
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

而且我也严格遵循 firebase_crashlytics configuration for native

答案 1 :(得分:0)

我这样做,这是最终的解决方案

Remove ios/Flutter/Flutter.podspec: rm ios/Flutter/Flutter.podspec
flutter clean
Run your app again.

如果以上解决方案不起作用,请尝试将频道从主频道切换到稳定频道。

要切换频道,请在终端中运行:

flutter channel stable

flutter clean

flutter run