>>> First add a plugin repository in your...
# gradle
x
>>
First add a plugin repository in your settings.gradle.kts file for the whole build:
Copy code
pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
    }
}
Then, map the plugin id to the corresponding artifact coordinates, still in your settings.gradle.kts file:
Copy code
pluginManagement {
    // ...
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "com.android.application") {
                useModule("com.android.tools.build:gradle:${requested.version}")
            }
        }
    }