Accepted answer

trying to install cloud firestore in flutter but got the problem. 

app/build.gradle file you've got:

apply plugin: 'com.google.gms:google-services'

This should actually be:

apply plugin: 'com.google.gms.google-services'

Notice the period between gms and google-services, instead of the colon.

Accepted answer

"Cordova-plugin-firebase causing – Plugin with id ‘com.google.gms.google-services’ not found"

some reason these lines were missing from the build.gradle file

// Fabric Cordova Plugin - Start Fabric Build Tools 
buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath 'com.google.gms:google-services:+'
    }
}

apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

Adding them back in solved my problem

apply plugin is  Should be:

apply plugin: 'com.google.gms.google-services'

Notice the . between com.google.gms and google-services.

Also, just in case, google() should go before jcenter().

add the google-services plugin to your build.gradle file.
In your top level file add:

buildscript {
  //....
  dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.3.3'
    }
}

Setting up Gradle plugins in the root build.gradle meanwhile works alike this:

plugins {
    id "com.android.application" version "7.3.1" apply false
    id "com.android.library" version "7.3.1" apply false
    id "com.google.gms.google-services" version "4.3.14" apply false
}

Then they can be applied in a module:

plugins {
    id "com.android.application"
    id "com.google.gms.google-services"
}