Ad

Cocoapods - FirebaseAnalytics Only Installed When Using FirebaseCore

So, this question is not about how to fix something, but about how it is working this way.

I want to use FirebaseMessage in my app for push notifications, which have a dependency FirebaseCore. I started just adding FirebaseMessage to my Podfile

pod 'Firebase/Messaging'

I got installed:

Installing Firebase (5.4.1)
Installing FirebaseCore (5.0.6)
Installing FirebaseInstanceID (3.1.1)
Installing FirebaseMessaging (3.0.3)
Installing GoogleToolboxForMac (2.1.4)
Installing Protobuf (3.6.0)

Okey, problem here is that I get a warning when building the project, because FirebaseAnalytics is missing. No problem, I can add:

pod 'Firebase/Messaging'
pod 'Firebase/Core'

and get:

Installing Firebase (5.4.1)
Installing FirebaseAnalytics (5.0.1)
Installing FirebaseCore (5.0.6)
Installing FirebaseInstanceID (3.1.1)
Installing FirebaseMessaging (3.0.3)
Installing GoogleToolboxForMac (2.1.4)
Installing Protobuf (3.6.0)
Installing nanopb (0.3.8)

...and I get nanopb and FirebaseAnalytics extra.

Why is this happening? Looking at the podspecs, FirebaseCore has no dependencies related to FirebaseAnalytics: https://github.com/CocoaPods/Specs/blob/master/Specs/8/b/d/FirebaseCore/5.0.6/FirebaseCore.podspec.json

I would like to find what tells cocoapods to install the FirebaseAnalytics pod, and why it only happens when I specifically install FirebaseCore.

Ad

Answer

Firebase/Core is the Core subspec of the Firebase pod. See details in the Firebase podspec.

While the FirebaseCore pod does not depend on FirebaseAnalytics, the Core subspec of the Firebase pod does.

It is unfortunate that "Core" is overloaded in Firebase terminology, but would tricky to change at this point without breaking a lot of apps.

Ad
source: stackoverflow.com
Ad