iosswiftfirebaseconfigcarthage

Cannot find 'FirebaseApp' in scope using Carthage instead of CocoaPods


there days i've been migrating my app's dependency management software from CocoaPods to Carthage and the thing is I don't know how to import "Firebase" module since there is no binary named FirebaseCore or only Firebase

The following content is from my cartfile

github "Alamofire/Alamofire" ~> 5.4.3
github "realm/realm-cocoa" ~> 10.12.0
github "onevcat/Kingfisher" ~> 6.3.1
github "hackiftekhar/IQKeyboardManager"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAppCheckBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAuthBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"

and everything is working but in my AppDelegate when I try to:

FirebaseApp.configure()

It returns the following error: Cannot find 'FirebaseApp' in scope since I cannot import the module Firebase which is available in CocoaPods. I have tried including different binaries from this link without any results.


Solution

  • After a while I discovered that in order to access FirebaseApp as well as Firebase module for importation, you must include the binary for FirebaseAnalytics, which appears to contain the FirebaseCore and Firebase modules.

    binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
    

    after adding that to Cartfile, you only need to import Firebase in your AppDelegate and then FirebaseApp.configure() will work again.