hey guys I would be grateful if anybody could help...
# android
i
hey guys I would be grateful if anybody could help me. I added gradle plugins in
settings.gradle.kts
like this:
Copy code
pluginManagement {
    repositories {
        gradlePluginPortal()
        google()
    }
Copy code
plugins {
        id(GradlePluginId.GRADLE_PLUGIN) version GradlePluginsVersion.GRADLE_PLUGIN
    }
}
that
GradlePluginId
and
GradlePluginVersion
are Kotlin objects, but the problem is they don't resolve with just this message: _*Unresolved reference: GradlePluginId Unresolved reference: GradlePluginVersion*_ however I can go to declaration and back to usage through the IDE. my project settings:
Copy code
implementation("com.android.tools.build:gradle:4.1.1")
distributionUrl=<https://services.gradle.org/distributions/gradle-6.5-bin.zip|https://services.gradle.org/distributions/gradle-6.5-bin.zip>
thank you.
v
They are Kotlin objects, but where are they?
Besides that this maybe more belongs to #gradle
i
they are in buildSrc
sorry, I didn't see #gradle
v
buildSrc
is executed after settings script evaluation in recent Gradle versions, so this no longer works.
👍 1
i
thanks, but what is the alternative in recent Gradle versions?
v
Publish the code you want to use to some repository and then add that to your script class path
👍 1
Or just don't do it but have the settings script hard-coded
In later versions there might be other alternatives like
i
Thqnk you very very much
v
yw
h
@Imany i wrote ab article explaining how to configure the plugins with regards to what @Vampire is talking about. Have a read here https://link.medium.com/9G2OygjYgdb