I can't use Kotlinx serialization with the Kotlin JVM plugin
In the instructions for Groovy DSL:
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.5.0'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.5.0'
}
Because I already use the org.jetbrains.kotlin.jvm
, I want to use it with the JVM plugin but the instructions do not explicitly show how.
In build.gradle
, I tried using:
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.5.0'
id 'org.jetbrains.kotlin.plugin.serialization' version '1.5.0'
...
}
In code:
import kotlinx.serialization.*
And, I get a compilation error (Unresolved reference: serialization
). How can I use kotlinx serialization with the JVM plugin? Also, I need it in the Groovy DSL syntax. The instructions already show it for the Kotlin DSL but I don't use it. Can anyone help?