Adding Libraries

Hi am trying to add libraries into the build.gradle based on the Antonio Leiva Book.
Keep getting errors all through

Build was configured to prefer settings repositories over project repositories but repository ‘Google’ was added by build file ‘build.gradle’

The code is as follows

/ Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.support_version = ‘28.0.0’
ext.kotlin_version = ‘1.3.20’
ext.anko_version = ‘0.10.8’

repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath "com.android.tools.build:gradle:7.0.2"
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}
allprojects {
repositories {
google()
mavenCentral()
}
}

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

What is the error you get? For Android you add your dependencies into the inner build file, not the topmost one. The one you’ve posted is the topmost one.