I'm getting: ``` Line 13: kotlin("plugin.seri...
# refreshversions
d
I'm getting:
Copy code
Line 13:     kotlin("plugin.serialization") version versionFor(Kotlin.stdlib)
                                                      ^ Unresolved reference: versionFor
for:
Copy code
kotlin("plugin.serialization") version versionFor(Kotlin.stdlib)
in my plugins block... I have an import for it on top...
b
Plugin blocks is a special snowflake and is not actually part of the buildscript. Therefore it uses an entirely different classpath, preventing you from using "regular" plugin utilities.
d
Oh.. so I can't pull kotlin's version to that somehow?
b
However, if you have
version.kotlin=xxx
in your versions.properties, you don;t need to specify the version for any of kotlin's subplugins (like serialization) as they all will use the same version
Just leave it as
Copy code
plugins {
  kotlin("plugin.serialization")
}
and set version in
versions.properties
under
version.kotlin=xxx
key
d
Doesn't work... I'm at 1.5.32 and it pulled 1.6.10...
b
Did it? What's the version set in versions.properties? Do you hard-code kotlin version in any of the buildscripts (outside versions.properties file)
d
Copy code
version.kotlin=1.5.32
no other hard coded ones... unless the json library pulls in 1.6.10...?
b
This is very likely seeing as gradle resolves version conflicts by picking highest version
d
What should I do about this?
b
Also remember that serialization plugin != serialization runtime dependency
Inspect your dependency tree to see what's bumping up your runtime dependency version
d
How do I exclude stdlib from here... it seems like that's the problem
b
I'd downgrade the lib instead of excluding stdlib
But if you're set on mismatching runtime/plugin versions, have a look at this (not recommended) https://docs.gradle.org/current/userguide/dependency_downgrade_and_exclude.html
Copy code
configurations {
    "compileClasspath" {
        resolutionStrategy.force("commons-codec:commons-codec:1.9")
    }
}
d
Yeah... I guess 1.3.1 still supports 1.5.31... not too bad. Thanks!