Xcode Build failed,fatal error: module 'firebase_auth' not found @import firebase_auth;

8,042

Solution 1

Update: I was able to eventually find a workaround by executing the following:

  1. Running Flutter Clean (in ios folder of project)
  2. Deleting both Podlock & Pod Folder
  3. Running pod init followed by pod install

seems to be an issue with the runner.xcworkspace folder and the build files needed to run builds.

Solution 2

These steps helped me to resolve the issue completely for IOS:
>> flutter clean
 then "delete podfile, podfile.lock, pod folder"
>> flutter pub get
>> pod install
>> flutter run

Solution 3

I tried to follow suggested steps of executing Flutter clean, manually removing podfile and podfile.lock along with Pod related folders, executing pod install again, etc. - nothing helped.

What helped me in the end was the following sequence:

  1. Create a new project with same dependencies declared in the pubspec.yaml.
  2. Run pub get in the new project.
  3. Run pod install in the new project to get everything generated
  4. Copy newly generated podfile and podfile.lock files to the old project.
  5. Run pod install in the old project.

Only after this sequence I was able to build the iOS project again.

Solution 4

I have got rid of this issue buy un-commenting the line in Podfile

 platform :ios, '10.0'

Also delete clean your project and rebuild again!

Solution 5

  1. It seems like you provided not a full Podfile's content (I can't see anything about Sayy target there) or you've been changing Podfile

  2. Depending on what you trying to archive either remove last 3 lines in Podfile or move line "pod 'AFNetworking', '~> 3.0'" to target 'Runner' right after 'use_modular_headers!'

  3. open XCode toppest item in left sidebar (blue icon) -> in leftest menu you will see two sections — Project and Targets. So names that are in 'targets' block — is the only one that can appear in Podfile after keyword 'target'

  4. everything depends on:

  • do you need AFNetworking?
  • what targets do you have in your application
Share:
8,042
Alrazi Bashir
Author by

Alrazi Bashir

Updated on December 21, 2022

Comments

  • Alrazi Bashir
    Alrazi Bashir over 1 year
        Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.5 19F101, locale en-US)
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.5)
    [✓] Android Studio (version 4.0)
    [✓] VS Code (version 1.46.1)
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 1 category.
    

    \\\Error Message

         ** BUILD FAILED **
    Xcode's output:
    ↳
        /Users/Razi/Desktop/projects/Sayy/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
    

    I have tried deleting Podfile/Podlock and running pod init/ pod install without success. Also have reviewed the GitHub repo for ios folder. Why is firebase_auth not found?

  • Igor Freitas
    Igor Freitas over 2 years
    monster ! the only way I could restore my installation after a long research
  • Vishwesh Soni
    Vishwesh Soni over 2 years
    I am facing this issue but can't find any solution tried all the steps