I have added the codes as desired
when i add the id 'com.google.gms.google-services' version '4.3.15' apply false to the android/build.gradle It throws me an error says A problem occurred evaluating root project 'android'. Could not find method id() for arguments [com.google.gms.google-services] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
and when i add second code which is the id 'com.google.gms.google-services' It throws me an error says A problem occurred evaluating project ':app'. Could not find method id() for arguments [com.google.gms.google-services] on project ':app' of type org.gradle.api.Project.