I'm using kotlin 2.1.20 and gradle 8.10, getting t...
# gradle
u
I'm using kotlin 2.1.20 and gradle 8.10, getting this error, have any idea how to resolve this?
Copy code
plugins -> kotlin("multiplatform") version "2.1.20"
kotlin {

    jvm {
        binaries {
            executable {

            }
        }
    }
    js(IR) {
        binaries.executable()
        browser {
            commonWebpackConfig {}
        }
    }
.....
e: 'java' Gradle plugin is not compatible with 'org.jetbrains.kotlin.multiplatform' plugin. Consider adding a new subproject with 'java' plugin where the KMP project is added as a dependency. e: 'application' (also applies 'java' plugin) Gradle plugin is not compatible with 'org.jetbrains.kotlin.multiplatform' plugin. Consider the new KMP/JVM binaries DSL as a replacement: https://kotl.in/jvm-binaries-dsl
v
As the error says, you apply the
application
plugin in a KMP project and this is not compatible anymore. Either use the
distribution
plugin directly, emulating what the
application
plugin did, or use that new incubating KMP functionality.
u
actually I've removed application plugin. cleaned project and tried again also. same issue.
t
could you share a Gradle build scan with error?
v
The
io.ktor.plugin
applies the
application
plugin for you
🤔 1
You should probably report to them that they are incompatible with KMP and they need to change their code. In the meantime you probably have to either downgrade Kotlin or not use that plugin.
t
will check it with Ktor developers. For now your solution would be either downgrade Kotlin version or Gradle version in project (to 8.6)
✅ 1
b
@Umesh Solanki the ktor plugin doesn't work with multiplatform - I'd advise generating a template from the HTMX plugin https://start.ktor.io/p/htmx for an example of a full-stack project