How to add Dependencies in project level Gradle in latest version?

Viewed 312

Project level Gradle is updated, now it looks like this

plugins {
    id 'com.android.application' version '7.1.2' apply false
    id 'com.android.library' version '7.1.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
}


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

anyway, I need to add this to my project level Gradle :

dependencies {
    classpath 'com.google.gms:google-services:4.3.10'

  }

I did read this article and still can't understand how to implement this!

1 Answers

Add dependencies as follows in your project level build.gradle file

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

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