GeneratedPluginConstraint,致命错误:未找到模块“firebase_auth”@import firebase_auth;

时间:2021-07-24 01:22:50

标签: firebase flutter dart firebase-realtime-database firebase-authentication

所以我在我的上一个项目中遇到了这个错误,同时尝试将它与我的 Flutter 应用程序的 firebase 链接起来。

所以对于这个项目,我从我的 github 下载了它,我从我的电脑上传了它,我尝试了 flutter run 但它显示了这个错误:

Desktop/app_with_firebase-main/ios/Runner/GeneratedPluginRegistrant.m:10:9: fatal error: module 'firebase_auth' not found
    @import firebase_auth;
     ~~~~~~~^~~~~~~~~~~~~
    1 error generated.
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.

我尝试先执行 flutter clean 再执行 deleting the pod files ,但它不起作用。但是在我的 Windows 中,我在 android 设备上运行该项目并且它运行得非常好。

感谢任何帮助,并且请解释该错误意味着什么,因为每次我在 ios 模拟器中使用 firebase/flutter 时,我 95% 的时间都会遇到此错误。

谢谢。

1 个答案:

答案 0 :(得分:0)

不要将 firebase_auth 包添加到 podfile。将它们添加到您的 pubspec.yaml 文件中。 FIrebase 网站上有关将 firebase 集成到您的应用中的说明专门针对 Android 和 iOS,但不适用于 Flutter。

删除您的 podfile 并尝试再次运行它。