Q:

Error in android gradle plugin : it must have dependency on com.google.firebase:firebase-core for firebase service to work as intended

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

A:

Your error clearly says that you're missing the Firebase Core library in your app/build.gradle.
Follow the steps below on how to set up Firebase in your app. Don't forget to add
dependencies {
 // ...
 implementation 'com.google.firebase:firebase-core:16.0.9'

 // Getting a "Could not find" error? Make sure that you've added
 // Google's Maven repository to your root-level build.gradle file
}

In your app/build.gradle file if you've already followed all the steps correctly.

