Android build error com.google.firebase:firebase-core:17.0.0

First, add build.gradle file, to include the google-services plugin and the Google's Maven repository:

buildscript {
// ...
dependencies {
    // ...
    classpath 'com.google.gms:google-services:4.0.1' // google-services 
plugin
}
}

 allprojects {
// ...
repositories {
    // ...
    maven {
        url "https://maven.google.com" // Google's Maven repository
    }
}
 }

add the apply plugin line at the bottom of the file to enable the Gradle plugin:

apply plugin: 'com.android.application'

android {
 // ...
 }

 dependencies {
  // ...
 implementation 'com.google.firebase:firebase-core:16.0.0'

  // Getting a "Could not find" error? Make sure you have
  // added the Google maven respository to your root build.gradle
  }

  // ADD THIS AT THE BOTTOM
  apply plugin: 'com.google.gms.google-services'

You should also add the dependencies for the Firebase SDKs you want to use. We recommend starting with com.google.firebase:firebase-core


I have fix problem : import onesignal

buildscript {
    repositories {
        maven { url 'https://plugins.gradle.org/m2/'}
    }
    dependencies {
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.10.1'
    }
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

repositories {
    maven { url 'https://maven.google.com' }
}

Remove implementation 'com.google.firebase:firebase-core:16.0.0' and useimplementation 'com.google.firebase:firebase-database:10.0.0' for firebase database, it will solve your problem.