简体   繁体   English

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

[英]GeneratedPluginConstraint , Fatal error: module 'firebase_auth' not found @import firebase_auth;

so I've got this error in my last project while trying to link it with firebase for my flutter app.所以我在上一个项目中遇到了这个错误,同时尝试将它与 firebase 链接到我的 flutter 应用程序。

So for this project, I downloaded it from my github which I uploaded it from my pc, I tried flutter run but then it shows me this error:所以对于这个项目,我从我的 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.

I tried doing flutter clean and then deleting the pod files , but it won't work.我尝试执行flutter clean然后deleting the pod files ,但它不起作用。 But in my windows, I run the project on the android device and it is working perfectly fine.但是在我的 windows 中,我在 android 设备上运行该项目并且它运行良好。

Any help is appreciated, and please explain what does that error means because everytime i use firebase/flutter in my ios emulator, I 95% of the time will get this error.感谢任何帮助,请解释该错误是什么意思,因为每次我在我的 ios 模拟器中使用 firebase/flutter 时,我 95% 的时间都会收到此错误。

Thank you.谢谢你。

Do not add the firebase_auth packages to the podfile.不要将 firebase_auth 包添加到 podfile。 Add them to your pubspec.yaml file.将它们添加到您的 pubspec.yaml 文件中。 The instructions on the FIrebase website to integrate firebase into your apps is specifically for Android and iOS, but not for flutter. FIrebase 网站上有关将 firebase 集成到您的应用程序中的说明专门针对 Android 和 iOS,但不适用于 Flutter。

Remove your podfile and try to run it again.删除您的 podfile 并尝试再次运行它。

I tried Everything on stackoverflow but the problem was with my googleService-Info.plist file.我在 stackoverflow 上尝试了所有内容,但问题出在我的 googleService-Info.plist 文件上。 I opened.xcworkspace file and tried creating build and it was showing error of file not found though it was present there.我打开 .xcworkspace 文件并尝试创建构建,它显示错误文件未找到,尽管它存在于那里。 I added the file again through xcode with runner target selected and everything started working.我通过 xcode 再次添加了文件,并选择了跑步者目标,一切都开始工作了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM