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

Abi*_*san 4 module fatal-error ios flutter firebase-analytics

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

\n
Xcode's output:\n\xe2\x86\xb3\n    ../ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module\n    'firebase_analytics' not found\n    @import firebase_analytics;\n     ~~~~~~~^~~~~~~~~~~~~~~~~~\n    1 error generated.\n    note: Using new build system\n    note: Building targets in parallel\n    note: Planning build\n    note: Constructing build description\n\nCould not build the precompiled application for the device.\n\nError launching application on Abir's iPhone.\n
Run Code Online (Sandbox Code Playgroud)\n

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

\n

Fra*_*id7 5

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

  1. 从 Xcode 文件夹中删除 DerivedData。打开 flutter 项目的 ios 文件夹内的 Runner.xcworkspace,然后单击 File -> Workspace Settings -> 单击 DerivedData 路径旁边的灰色箭头,然后删除 Xcode 文件夹内的 DerivedData。 在此输入图像描述

在此输入图像描述

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

在此输入图像描述

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

在此输入图像描述

  1. 运行您的应用程序(它将生成一个新的 podfile,不要编辑此 podfile)它应该可以工作。


小智 5

是打开Runner的问题。打开 Runner.xcworkspace 而不是 Runner.xcodeproj。在此输入图像描述