Slackbot
04/28/2023, 8:16 PMVampire
04/28/2023, 8:26 PM--scan
?Luc-Antoine Girardin
04/28/2023, 8:35 PMLuc-Antoine Girardin
04/28/2023, 8:45 PMimplementation("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
in buildSrc/build.grade.kts
which I understand influences the kotlin-dsl
version. But changing its version still causes errorsChris Lee
04/28/2023, 9:05 PMkotlin-dsl
as is.
The issue is due to a back-version of the kotlin-dsl plugin expecting Kotlin 1.5 but upgraded to Kotlin 1.8.10 (as expected, to align with embedded Kotlin).Chris Lee
04/28/2023, 9:08 PMimplementation("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
is not kotlin-dsl,
which is a Gradle-provided plugin (not Jetbrains). that kotlin-gradle-plugin is from kotlin(“jvm”) in a build script.
Related to that, build scripts should never mix kotlin(“jvm”) (which is for your application code) with kotlin-dsl
(which is for your build script code).Chris Lee
04/28/2023, 9:11 PMkotlin-dsl
and kotlin("jvm")
, resulting in conflicting Kotlin versions. As noted above, never do that - any given script (or custom plugin) is either building Gradle code (kotlin-dsl
) or your application code (kotlin("jvm")
)Luc-Antoine Girardin
04/28/2023, 9:54 PMkotlin-dsl
and kotlin("jvm")
in the same gradle file... My buildSrc/build.gradle.kts
looks like this:
plugins {
`kotlin-dsl`
}
repositories {
google()
mavenCentral()
mavenLocal()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
implementation("com.android.tools.build:gradle:_")
implementation("custom plugin already working")
implementation("new plugin which breaks the build")
}
I've been using refreshVersions for version management. I tried removing <http://plugin.org|plugin.org>.gradle.kotlin.kotlin-dsl=2.1.7
, but it also does not helpChris Lee
04/28/2023, 10:13 PMimplementation(“org.jetbrains.kotlin:kotlin-gradle-plugin:_“)
Vampire
04/28/2023, 10:18 PMVampire
04/28/2023, 10:18 PMChris Lee
04/28/2023, 10:18 PMVampire
04/28/2023, 10:23 PMVampire
04/28/2023, 10:23 PMThis version of Gradle expects version '4.0.7' of theplugin but version '2.1.7' has been applied to project ':buildSrc'. Let Gradle control the version ofkotlin-dsl
by removing any explicitkotlin-dsl
version constraints from your build logic.kotlin-dsl
Luc-Antoine Girardin
04/28/2023, 10:26 PMimplementation(“org.jetbrains.kotlin:kotlin-gradle-plugin:_“)
and it's still not workingChris Lee
04/28/2023, 10:26 PMVampire
04/28/2023, 10:26 PMLuc-Antoine Girardin
04/28/2023, 10:27 PMVampire
04/28/2023, 10:27 PMVampire
04/28/2023, 10:28 PMVampire
04/28/2023, 10:28 PMLuc-Antoine Girardin
04/28/2023, 10:57 PM