After including CatalystPodSupport I get error "Could not build Objective-C module 'Firebase'" on Mac app
ericbenwa opened this issue · 2 comments
I'm guessing this is happening because I've successfully removed Firebase from the Mac app using this repo but it's still trying to import Firebase
because it's listed in my ViewController.swift.
ViewController.swift
import Firebase
Error: "Could not build Objective-C module 'Firebase'"
and throughout ViewController.swift I am calling Analytics events that use Firebase.
Analytics.logEvent("HelpOpen", parameters: nil)
Podfile of section listing unsupported pods:
def catalyst_unsupported_pods [ "Crashlytics", "Fabric", "Firebase/Analytics", "Firebase/Core" ] end
If I'm removing Firebase from the Mac app, how do I handle the (disconnected for Mac) references to that pod in my ViewController?
Any thoughts or pointers?
I'm new to Swift so not sure of what's available.
Note: Builds fine for iOS Simulator.
Thanks!
Hi @ericbenwa , if you see the documentation here you see you need to use compiler flags to avoid using that code in your ViewController
:
#if !targetEnvironment(macCatalyst)
import Firebase
#endif
And then:
#if !targetEnvironment(macCatalyst)
// use Firebase functionality here
Analytics.logEvent("HelpOpen", parameters: nil)
#endif
Ah, yes, thank you!
I'm an idiot, I just needed to scroll up a little more on the README.
Was scouring too low and the Issues.