Pavel S
05/24/2023, 5:41 PMbuildscript , classpath , allProjects etc. to pluginManagement , plugins , dependencyResolutionManagement etc. However errors like this happen on sync:
Error resolving plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '1.8.10', apply: false]
> The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked.
I suspect that this might be connected to the fact that I’m also using convention-plugins in buildSrc and therefore add several gradle plugins as dependencies in build.gradle.kts of buildSrc like this (but I’m not sure how to rewrite it):
plugins {
`kotlin-dsl`
}
repositories {
google()
mavenCentral()
mavenLocal()
maven(url = "<https://maven.pkg.jetbrains.space/public/p/compose/dev>")
}
dependencies {
implementation(Deps.Kotlin.gradlePlugin)
// ...
}
How can this be fixed?Vampire
05/24/2023, 5:59 PMid("org.jetbrains.kotlin.multiplatform") version "1.8.10" apply false?Pavel S
05/24/2023, 6:01 PMbuild.gradle.kts plugins blockAdam S
05/24/2023, 6:03 PMbuildSrc/build.gradle.kts add all Gradle plugins in the dependencies {} block (using the Maven GAV coordinates, not the plugin ID). Then I don’t need to add the plugin versions anywhere else, they’re defined in a single place.
This looks like what you’ve done too, so you probably just need to remove the versions:
plugins {
kotlin("multiplatform") // no version needed - it's in buildSrc/build.gradle.kts
}Vampire
05/24/2023, 6:03 PMimplementation dependency in buildSrc anyway.
That already serves the same purpose.Vampire
05/24/2023, 6:04 PMso you probably just need to remove the versionsNo, the whole line 😉