0

My project's build.gradle code =

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

I am trying to add classpath 'com.google.gms:google-services:4.3.13' in my project's build.gradle file but am not getting any space to paste. Even I have tried putting this before and after plugins =

dependencies {
  classpath 'com.google.gms:google-services:4.3.13'
}

Still I am having problem. I also have tried to insert plugins inside dependencies but problem still occurs.

Now, I need a solution.

2 Answers2

3

buildscript {
    dependencies {
        classpath 'com.google.gms:google-services:4.3.13'
    }
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

happy code!!!

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 14 '22 at 17:22
2

I am answering my problem just because to help out people who couldn't solve it.

The main thing here is, we have to add the dependencies before the "// Top level build....".

I solved it sometimes before with a help.

The code should be:

dependencies {
  classpath 'com.google.gms:google-services:4.3.13'
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

This is the main solve. You can add more classpaths if you want.