Error with LoginForm

I have run into a problem in Lesson 3 Module 1 of the IOS Database Course. When I run pod install I don’t get a .xcworkspace. I have tried looking it up and nothing is working :frowning:

I ended up following the way that firebase describes which doesn’t use cocoapods but rather you just add the package through Xcode. I don’t get any errors from this so I am going to run with it right now. Will this give me problems in the future?

Welcome to the community! No it’s actually recommend to use Swift Package Manager, as opposed to Cocoapods

Chris’ original tutorial is only a tad outdated with that, because Firebase changes all the time and SPM is new

Hi, thank you for the response @mikaelacaron. Everything was working great until I got to Module 3 and I needed to install Firebase UI through Cocoapods and again it did not work. I saw there was a package for Firebase UI, but when I tried installing it, it said “Package could not be resolved.” So what can I do now?

Oh Phew! I solved the problem I uninstalled Cocoapods and reinstalled it using brew, which is what the internet told me to do, so now it works properly. I was still wondering though. It is a lot easier to install Firebase through the packages than through Cocoapods, so could I install like FirebaseFirestore and FirebaseAuth through pakages and then the FirebaseUI through Cocoapods or just all through cocoapods

I have a new error now saying

Thread 1: “The default FirebaseApp instance must be configured before the default Authinstance can be initialized.”

Here is my code

import SwiftUI
import Firebase

@main
struct Firebase_Auth_DemoApp: App {
    
    init() {
        FirebaseApp.configure()
    }
    
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}
import SwiftUI

struct ContentView: View {
    var body: some View {
        LoginForm()
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
import Foundation
import SwiftUI
import FirebaseAuthUI
import FirebaseEmailAuthUI

struct LoginForm: UIViewControllerRepresentable {
    func makeUIViewController(context: Context) -> UINavigationController {
        
        let authUI = FUIAuth.defaultAuthUI()
        
        guard authUI != nil else {
            return UINavigationController()
        }
        
        let providers = [FUIEmailAuth()]
        authUI!.providers = providers
        
        return authUI!.authViewController()
    }
    
    func updateUIViewController(_ uiViewController: UINavigationController, context: Context) {
        
    }
}

Can you split this into a new thread? Because your original question Lesson 3 Module 1, but now your new one is in a different module

I actually ended up getting it to work. Originally I was getting the import Firebase from the package but I tried with no packages and all Cocoapods and it worked!

The problem is that it appears that the different Auth options that are available via cocoapods are not all available via Swift Package Manager since the only option you have in terms of “Auth” is to select the framework FirebaseAuth when installing Firebase from this GitHub link:

https://github.com/firebase/firebase-ios-sdk

As to whether there are any other GitHub repos listing other Firebase Auth capabilities, suitable for SPM, I don’t know.