'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.

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 :

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. But in my windows , I run the project on the android device and it is working perfectly fine.

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.

Thank you.



Solution 1:[1]

Do not add the firebase_auth packages to the podfile. Add them to your pubspec.yaml file. The instructions on the FIrebase website to integrate firebase into your apps is specifically for Android and iOS, but not for flutter.

Remove your podfile and try to run it again.

Solution 2:[2]

I tried Everything on stackoverflow but the problem was with my googleService-Info.plist file. I opened .xcworkspace file and tried creating build and it was showing error of file not found though it was present there. I added the file again through xcode with runner target selected and everything started working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Srinivas Kandala
Solution 2 mohit48