Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

As far as I know, individual Firebase libraries like firebase-auth didn't used to require me to include firebase-core .

However, I recently started a new Android project, and when I tried to build without firebase-core , I got the following Java compiler warning:

Warning: The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended.

UPDATE : AUGUST 2019

The docs now show whether a specific product SDK requires firebase-analytics , if firebase-analytics is recommended , or if it is not needed at all.

firebase-core is no longer listed as a required dependency in the Android getting started guide and was removed from the list of available libraries .

Now adding firebase-analytics to your app is optional in the getting started guide . Products that do require firebase-core , such as In-App Messaging , list the firebase-core dependency in their setup guides.

ORIGINAL ANSWER:

This is a recent change as of May 23, 2018. Per the release notes :

Your app gradle file now has to explicitly list com.google.firebase:firebase-core as a dependency for Firebase services to work as expected.

This requirement is reflected in the "Set up {X} for Android" guides ( example ) in the step "Install the Firebase SDK". That step links to this page , which includes the requirement to add firebase-core .

edit 9/26/18: A summary of features that rely on Google Analytics for Firebase (and therefore firebase-core ) can be found here .

I'm not a fan of this answer. Yes google says we should put it in, but if it's actually mandatory, why didn't google make it a required dependency in the maven POM file? Why make everyone explicitly reference it for no reason? This is doubly suspicous, because firebase-core is actually just google analytics for firebase; personally I want NOTHING to do with google analytics and it's privacy invading user-tracking, but can I really opt-out here? We use firebase-messaging as it's required to send push notifications to android Orion Edwards Jul 9, 2018 at 2:27 Firebaser here. That's a good comment! Where we have a hard dependency, we do add it as a POM dep. However, there are a bunch of services that have soft dependencies (FCM, Remote Config, Predictions, A/B Testing, Crashlytics etc.) where Analytics adds a lot of value. You can disable analytics tracking ( firebase.google.com/support/guides/disable-analytics ), which will mean you get enable it only if you have consent etc. Ian Barber Jul 10, 2018 at 16:03 @IanBarber Thanks for explaining, but will keeping out firebase-core / firebase-analytics do any harm to the things that have soft dependencies? Rolf ツ Aug 29, 2018 at 13:24 @IanBarber I'm asking this because you are basically saying: "Analytics is useful so you must add the dependency, if you don't like it you can disable it". Why not leave it out in the first place then? Rolf ツ Aug 29, 2018 at 13:28 You can ignore the warning with FCM, but it will stop some reporting of messaging open stats etc. in some cases. Ian Barber Sep 1, 2018 at 1:18 I'm pretty sure he/she is saying that they don't want to add the core dependency as they aren't even using it, so why would adding it be a solution? behelit Jan 8, 2019 at 2:54

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .