IDontKnowCode
IDontKnowCode

Reputation: 63

How to fix the error "No such module "FirebaseAuth"

I installed all the pods that I needed, but Xcode shows me an error "No such Module FirebaseAuth", I tried this I found:

  1. Shift+ Command + K to clean the workspace
  2. I reinstalled the podfile in the Terminal
  3. Command + b
  4. I am already in the workspace, not in the project file
  5. I didn't know if that helps but I reinstalled the computer.
import UIKit
import FirebaseAuth
import FirebaseDatabase
import FirebaseStorage

Here is the Pod file:

target 'Ouvrigram' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

    pod 'Firebase/Core'
  pod 'Firebase/Database'
  pod 'Firebase/Storage'
  pod 'Firebase/Auth'
  # Pods for Ouvrigram

end

I installed all the pods, I checked there are installed, I don't​ know what I am to do Pls help.

Upvotes: 6

Views: 12782

Answers (6)

If you imported everyting needed, always try to reset packages cache! Worked well for me

Once you are in XCode: File -> Packages -> Reset Package Caches

Upvotes: 2

Borna
Borna

Reputation: 41

First click on your project on the left side then go to General tab and scroll down to Frameworks, Libraries and Embedded Content, click on the + and add the module that you need.

Upvotes: 4

mdn0403
mdn0403

Reputation: 13

This may happen if you forget to run the pod init command in the terminal.

Upvotes: 1

user7894007
user7894007

Reputation:

XCode is really buggy and Apple isn't really excited about improving their compatibility with Google services. I get the same error even after importing:

  • import Firebase
  • import FirebaseFirestore
  • import FirebaseAuth
  • import FirebaseFirestoreSwift

But my project builds and runs successfully in spite of all the RED errors everywhere on my project. In fact, a simple "import Firebase" is enough for a successful build.

XCode Version 13.4.1 (13F100)

Upvotes: 2

Joe Bobson
Joe Bobson

Reputation: 1386

Try to replace content of your Podfile with Podfile-ios-objc https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/cocoapods/Podfile-ios-objc

It works for me.

Upvotes: 0

Quentin Rth
Quentin Rth

Reputation: 305

Are you sure the target name is the same as your Xcode project name ? Also make sure you are opening the project with the .xworkspace file. You can't use the .xcodeproj file anymore if you are using pods

Upvotes: 6

Related Questions