Hello is it possible to add `kotlin-parcelize` fo...
# gradle
n
Hello is it possible to add
kotlin-parcelize
for Kotlin library/module (not-android) ? Can anyone share how as I am getting error regarding android package. ? Here is my kotlin module
build.gradle.kts
Copy code
plugins {
    id("java-library")
    id("org.jetbrains.kotlin.jvm")
    id("kotlinx-serialization")
    id("kotlin-parcelize")
}

java {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.4.1")
}
e
no, the
kotlin-parcelize
plugin is only for Android
how would it even work in a non-Android library? it depends on
kotlin-parcelize-runtime
and classes from Android
n
@ephemient Thanks for clarifying 🙇
c
The Essenty library has experimental support for parcelize in Darwin and JVM targets https://github.com/arkivanov/Essenty#parcelable-and-parcelize. But unless you’re using directly with Decompose, it’s probably best to use a proper serialization library; Parcelable was never meant as a general-purpose serialization technique
419 Views