Android Gradle - Error while adding Firebase

I was following the Firebase doc which told me to put this line

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

It told to put this below

apply plugin: 'com.android.application'

but I don't have any line like this, all I have is this:-

plugins {
    id 'com.android.application'
}

Where should I put the above line? (Also see that, I am new to programming so please explain whatever solution you give :)

Thank you


Try doing it like this:

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

Actually, both ways roughly do the same thing.