From this thread, https://github.com/firebase/firebase-ios-sdk/issues/3136, Firebase is going to be supporting SPM in the coming near future. Would your team consider doing so as well?
Thanks!
I've done some prototyping in https://github.com/firebase/FirebaseUI-iOS/tree/pb-spm. Since SPM does not have a concept of subspecs, there will need to be a strategy about how to map those to SPM and what the implications will be to imports.
@paulb777 any estimate on SPM support since firebase SDK already offers one?
Since UISDK has a dependency on firebaseSDK, we cannot use SPM anywhere atm.
Hello, Any update on this?
Thanks
I did try to install pb-spm branch and it failed with an error:

Hello!
Anyone managed to install FirebaseUI with SPM yet?
I've managed to install FirebaseUI SPM using the pb-spm branch. I needed to do a clean build, and replace imports of Firebase/FirebaseUI with imports of FirebaseStorage, FirebaseFunctions, AuthUI, EmailUI, etc, but it builds OK.
However, when I run the code below it fails with
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle <...> (loaded)' with name 'FUIAuthPickerViewController''
I'm guessing FUIAuthPickerViewController.nib isn't appearing in the resource dependencies. Is there a workaround or fix for this?
import SwiftUI
import AuthUI
import EmailUI
struct LoginView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
let authUI = FUIAuth.defaultAuthUI()
authUI?.providers = [FUIEmailAuth()]
return authUI!.authViewController()
}
func updateUIViewController(
_ uiViewController: UIViewController,
context: UIViewControllerRepresentableContext<LoginView>
) {
}
}
I fixed the initial NIB error by explicitly specifying the FirebaseUI bundles in the delegate, but then it crashes trying to load the FUIAuthTableViewCell NIB, and I can't find a way to specify the bundle for that class. In any case, the strings in the UI are wrong ("AuthPickerTitle", "SignInWithEmail") and the email icon is missing. So I'm still looking for a way forward.
class AuthDelegate: NSObject, FUIAuthDelegate {
private var authBundle: Bundle?
private var emailBundle: Bundle?
override init() {
super.init()
if let bundleURL = Bundle.main.url(
forResource: "FirebaseUI_AuthUI",
withExtension: "bundle") {
authBundle = Bundle(url: bundleURL)
}
if let bundleURL = Bundle.main.url(
forResource: "FirebaseUI_EmailUI",
withExtension: "bundle") {
emailBundle = Bundle(url: bundleURL)
}
}
func authPickerViewController(
forAuthUI authUI: FUIAuth
) -> FUIAuthPickerViewController {
return FUIAuthPickerViewController(
nibName: "FUIAuthPickerViewController",
bundle: authBundle,
authUI: authUI)
}
func emailEntryViewController(
forAuthUI authUI: FUIAuth
) -> FUIEmailEntryViewController {
return FUIEmailEntryViewController(
nibName: "FUIEmailEntryViewController",
bundle: emailBundle,
authUI: authUI)
}
}
@paulb777 Any update on when this might move from prototype to main? Would love to get some of the latest updates and fixes that have been pushed out! Would also love to be able to use this for other things besides AuthUI!
Edit: Not only would I appreciate being able to use SPM, but SPM is also the only way I can do dependency management now. A lot of problems with Cocoapods on M1 Macbooks (even running on Rosetta). This would mean the world and allow me to once again use this wonderful library!
Nice to see I'm not the only one waiting for this..
Hey all, additional progress has been made on the pb-spm branch. Please test out the new changes and let me know if you run into any issues.
@morganchen12 thank you for making those updates! So close now, seeing a similar but different issue to what @mattkwan was seeing.
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not find country code file'
Guessing something is wrong with linking within PhoneAuthUI
Whatever you did to fix Matt's issue worked because I was previously seeing that issue as well when commenting out a bunch of code that was using the previously unsupported modules. Do you think you could apply the same fix from FUIAuthPickerViewController.nib onto the country code file?
@morganchen12 scratch that. I actually tried to start an AuthVC up without phone auth in the list of providers and got the same error as Matt:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle <> (loaded)' with name 'FUIAuthPickerViewController''
@nikitaame the missing bundle resources should be fixed now.
@morganchen12 everything looks good and is running smoothly minus one small bug. Think some localization file might still not be linked? Seeing a TermsOfServiceMessage key instead of an actual string.

Otherwise, thank you for your amazing work! I am finally able to once again work with Firebase + FirebaseUI thanks to you! Will this be out in the next release?
Got it to work too! Thank you! - Can approve that there seems to be something wrong with Localization.


Also maybe wrong forum but how do we achieve FacebookAuth/GoogleAuth/AppleAuth with this library?

Facebook Auth and Google Auth both have library dependencies that do not support SwiftPM (Facebook supports SwiftPM only for its Swift SDKs, but we depend on their ObjC SDKs since FirebaseUI is an ObjC project). Unfortunately, we're blocked on those libraries.
I'll take a look at the localization files bug soon.
Any update on the localization bug? This still seems to be an issue.
The localization resources bug should now be fixed.
So sorry - I'm missing something basic on understanding which URL to use to test this. I've tried:
https://github.com/firebase/FirebaseUI-iOS/compare/pb-spm
and
https://github.com/firebase/FirebaseUI-iOS/tree/pb-spm
but I get an error:
"The remote repository could not be accessed: Make sure a valid repository exists at the specified location and that the correct credentials have been supplied."
I'm sure I'm just missing something newbie-ish. Thanks for tolerating the question & correcting what I'm missing.
See Paul's comment in your other issue: https://github.com/firebase/firebase-ios-sdk/issues/7824#issuecomment-814410862
Before the most recent update, FirebaseUI was working fine, however when I tried to update to the latest version to get the localization fixes, I got this error.

@thecodeguyexamples seems to be working fine for me. Did you try the usual reset of SPM cache, clean derived data, etc dance?
Thanks for fixing this @morganchen12!
Facebook Auth and Google Auth both have library dependencies that do not support SwiftPM (Facebook supports SwiftPM only for its Swift SDKs, but we depend on their ObjC SDKs since FirebaseUI is an ObjC project). Unfortunately, we're blocked on those libraries.
I'll take a look at the localization files bug soon.
@morganchen12 do you expect Facebook Auth and Google Auth to support SwiftPM in the future?
Facebook Auth already supports SPM, though only for their Swift module, which we cannot use since FirebaseUI is an ObjC project. It's unclear if they'll add SPM support for their ObjC libraries as well. If ObjC usage of the Facebook Auth FirebaseUI module is low, we could rewrite it in Swift easily since it's very small.
Google Auth will add SPM support in the future.
SPM support has now landed in master, and will be released after the Firebase 8 major version update.
Prof. John Gallaugher - @gallaugher
Boston College
YouTube: https://youtube.com/profgallaugher
Learn to lead in tech: http://gallaugher.com/book
Learn to build apps: http://gallaugher.com/swift/
On Apr 27, 2021, at 1:56 PM, Morgan Chen @.*> wrote:
SPM support has now landed in master, and will be released after the Firebase 8 major version update.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

i have problem when i using SPM and i oull branch pb-spm anyone have this problem?
Hi all,
thanks for the effort! I also get the following errors using the pb-spm or master branch.
"Could not build Objective-C module 'FirebaseAuthUI'"

@Tixamaster It worked for me when I made the following change: https://github.com/nipapadak/FirebaseUI-iOS/commit/11db727368474ebce6581ad379ca3bf285945ca4
@nipapadak Thanks a lot that solved this problem!
Now I get the following (did the FUI names also change?):

In addition I still get this compiler error:

@Tixamaster the module names changed, so now you need to import each auth provider module separately.
import FirebaseEmailAuthUI
// ...
@Tixamaster the module names changed, so now you need to import each auth provider module separately.
import FirebaseEmailAuthUI // ...
Thanks! But I still get the compiler error shown above :/
Header import errors should be fixed in bb544f86a968540aad354841a892c52ccff839ea.
Facebook Auth already supports SPM, though only for their Swift module, which we cannot use since FirebaseUI is an ObjC project. It's unclear if they'll add SPM support for their ObjC libraries as well. If ObjC usage of the Facebook Auth FirebaseUI module is low, we could rewrite it in Swift easily since it's very small.
Google Auth will add SPM support in the future.
On the facebook-ios-sdk README under Swift Package Manager it says:
If you explicitly DO NOT want to include Swift, import FBSDKCoreKit FBSDKLoginKit and FBSDKShareKit
Doesn't that mean that they have SPM support for ObjC libraries?
When my app starts, I get the following error message:
Thread 1: "Could not load NIB in bundle: 'NSBundle
name 'FUIAuthPickerViewController'"
Does anyone know how to fix this? For reference, I am using
commit bb544f86a968540aad354841a892c52ccff839ea
On Tue, May 4, 2021 at 2:08 AM Anders Tidbeck @.*>
wrote:
Facebook Auth already supports SPM, though only for their Swift module,
which we cannot use since FirebaseUI is an ObjC project. It's unclear if
they'll add SPM support for their ObjC libraries as well. If ObjC usage of
the Facebook Auth FirebaseUI module is low, we could rewrite it in Swift
easily since it's very small.Google Auth will add SPM support in the future.
On the facebook-ios-sdk README under Swift Package Manager
https://github.com/facebook/facebook-ios-sdk#swift-package-manager-available-xcode-112-and-forward
it says:If you explicitly DO NOT want to include Swift, import FBSDKCoreKit
FBSDKLoginKit and FBSDKShareKitDoesn't that mean that they have SPM support for ObjC libraries?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-iOS/issues/886#issuecomment-831728137,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMHEO7L72TTPU6LGYU37KKTTL6MNLANCNFSM4PLC3R7Q
.
@thecodeguyexamples can you share the path in the error?
The path is
/Users/username/Library/Developer/CoreSimulator/Devices/754868BC-5DD0-45EB-AF8E-C32BC117E1C3/data/Containers/Bundle/Application/46A6A277-27C0-4735-8598-992BA32D4455/eLibrarian.app
On Tue, May 4, 2021 at 4:30 PM Morgan Chen @.*> wrote:
@thecodeguyexamples https://github.com/thecodeguyexamples can you share
the path in the error?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-iOS/issues/886#issuecomment-832261427,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMHEO7JYA2QOQATE5PUK24LTMBRQNANCNFSM4PLC3R7Q
.
@thecodeguyexamples Thanks, should be fixed in 4201323c666c0f7664ff24a5d915b7017d6fc8ff.
Alright, I will test this out when I get the chance.
Thy it works now. But I don't get access to the name of the user when using Apple Sign In.
Is this a general issue or only with the new SPM packaging?
@Tixamaster that's a regression unrelated to SPM.
Okay thanks. Can you maybe push me to a hint where I can get the name? As I could only find a closed issue with the info that it should have been implemented.
@Tixamaster please file a separate issue.
I see Paul's comment that the branch is pb-spm, but when I try the following, Xcode can't seem to resolve FirebaseUI-iOS.git if I select "branch" and add "pb-spm". See error, below. I've already installed Firebase 8.0 using SPM in this project.
So sorry if I'm missing something basic, but how do I install this branch using Swift Package Manager. Thanks!


Hey @gallaugher, you should be using the master branch now. Note that FirebaseUI has not yet been updated for Firebase 8 support. I'll do that soon.
Just tried rolling back Firebase to 7.9 and installing with SPM, then tried AuthUI and got this error:

I got an error similar to this.
On Fri, May 14, 2021 at 3:19 PM Gallaugher @.*> wrote:
Just tried rolling back Firebase to 7.9 and installing with SPM, then
tried AuthUI and got this error:
[image: AuthUI problem]
https://user-images.githubusercontent.com/20801687/118324473-1a28a280-b4d0-11eb-8d8b-8d22bca0a435.png—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/firebase/FirebaseUI-iOS/issues/886#issuecomment-841479988,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMHEO7NFLCWDQKTCAL37XATTNWAVBANCNFSM4PLC3R7Q
.>
Sincerely,
Ian Haas
Sent from my iPad
SPM support on master is now updated for Firebase 8. Please clear your package caches and try reinstalling.
Also added Facebook login support.
This has now been released.
Most helpful comment
@paulb777 any estimate on SPM support since firebase SDK already offers one?
Since UISDK has a dependency on firebaseSDK, we cannot use SPM anywhere atm.