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

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

Ask Question

here is the screenshot i want to run a project in android studio. but when i click run button it's showing me the error

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

As the warning is clearly stating, you're trying to use a library that needs firebase-core to work. Basically all Firebase plugins need to have the Firebase core library added for them to work.

To fix your problem add the library to your App build.gradle file:

implementation 'com.google.firebase:firebase-core:16.0.6'

When adding a new App to your Firebase Console you need to follow the steps as below:

Not all firebase libs need to have core in graddle. for example if you want to just use auth plugin you just use it like com.google.firebase:firebase-auth:16.1.0 rgaraisayev Jan 26, 2019 at 11:08 @rgaraisayev when you add a new App to your Firebase Console, the 3rd step asks you to clearly add the core library. 113408 Jan 26, 2019 at 11:11 This is general information. And it is not recommended to add core to gradle if you are going to use a few plugins. You must add what you need, otherwise your method count will rocket, then you will need to use multidexing rgaraisayev Jan 26, 2019 at 11:17 To address your specific question, firebase-auth requires firebase-core as stated by official doc : support.google.com/firebase/answer/6383877?hl=en#features 113408 Jan 26, 2019 at 11:21 I say it is not required, but you still arguing. I have working project that uses auth plugin in front of me, and there is not core dependency explicitly defined in gradle. Calm down rgaraisayev Jan 26, 2019 at 11:32