首页 > 解决方案 > Flutter 无法在 ios 模块上构建 'cloud_firestore' not found @import cloud_firestore;

问题描述

我正在使用 codemagic 部署到我在 App Store 上的应用程序。Android 构建很好,但是当它为 IOS 构建时,我收到此错误:

 /Users/builder/clone/ios/Runner/GeneratedPluginRegistrant.m:12:9: fatal error: module 'cloud_firestore' not found
    @import cloud_firestore;

这是我的 Podfile。

# Uncomment the next line to define a global platform for your project
platform :ios, ’10.0’

target 'Runner' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
 # Pods for Runner
end

我做了 pod install 和更新,但我不能,flutter build ios因为我在 Windows 上。我怎样才能解决这个问题?

标签: iosflutter

解决方案


我多次遇到这个问题,这是我修复它的过程:

  • 升级 Firebase 发布包
  • 记得同时添加 Firebase Core 包
  • 请记住将 Runner 添加到您使用GoogleService-Info.plist的 Runner 文件夹中,因为它需要链接。ios/Runner.xcworkspaceXcode
  • 使用终端flutter clean
  • flutter pub get
  • cd ios
  • pod cache clean --all
  • pod install
  • pod update

然后尝试再次运行该项目或再次构建它。


推荐阅读