Ionic latest add firebase

go to
yourAppName\platforms\android\cordova-support-google-services
and open yourAppName.gradle file
check is there

buildscript {
repositories {
jcenter()
mavenCentral()
}

dependencies {
    classpath 'com.android.tools.build:gradle:+'
    classpath 'com.google.gms:google-services:4.0.2'
}

}

// apply plugin: ‘com.google.gms.google-services’
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
ext.postBuildExtras = {
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
}