颤振:致命错误:未找到模块“firebase_analytics”

时间:2021-03-18 05:37:42

标签: ios flutter module firebase-analytics fatal-error

在 iOS 上添加 firebase 依赖后,当我想运行时出现此错误

Xcode's output:
↳
    ../ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module
    'firebase_analytics' not found
    @import firebase_analytics;
     ~~~~~~~^~~~~~~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

Error launching application on Abir's iPhone.

我已经尝试了很多方法。如删除 pod 文件、pod 更新、pod 安装等

3 个答案:

答案 0 :(得分:1)

我遇到了同样的错误,这是解决方法。

  1. 从 Xcode 文件夹中删除 DerivedData。在你的flutter项目的ios文件夹中打开Runner.xcworkspace,然后点击File -> Workspace Settings -> 点击DerivedData路径旁边的灰色箭头,删除Xcode文件夹中的DerivedData。 enter image description here

enter image description here

  1. 删除 flutter 项目的 ios 文件夹中的 Podfile 和 Podfile.lock 文件。
  2. 将部署目标更改为 12.0。您将在 General -> Deployment Info 下找到部署目标。

enter image description here

  1. 清理你的 ios 构建文件夹。

enter image description here

  1. 运行你的应用(它会生成一个新的 podfile,不要编辑这个 podfile)它应该可以工作。

答案 1 :(得分:0)

将 General -> Deployment Info 下的 Deployment Target 与平台 :ios 匹配,Podfile 中的“11.0”版本为我解决了这个问题。

答案 2 :(得分:0)

pod repo update 或与 pod install --repo-update