I have this data class ```@Serializable data class...
# kotlin-native
s
I have this data class
Copy code
@Serializable
data class User(
    @SerialName("UserName")
    val name: String,
    @SerialName("UserId")
    val userID: String,
)
and yet I'm seeing the following exception
Copy code
name: Error Domain=KotlinException Code=0 "No transformation found: class kotlin.ByteArray -> class com.xxx.kmmsharedmodule.User
in my kmm module
r
I think that error usually means something wrong in your Ktor or Serialization configuration but it's hard to say without more code.
s
It is a compile time issue but I think that was already apparent.
what else can I provide in order to get more thoughts/ideas to investigate?
r
if it's compile-time, maybe you're missing the serialization plugin?
s
just wanted to make sure
r
I usually use the plugins block rather than apply plugin but either should work. It's probably easiest to just do the same thing as you're doing for the kotlin plugin.
👍 1
s
Actually the client seems to be doing it...
Copy code
private val httpClient by lazy {
        HttpClient(httpEngine) {
            install(JsonFeature) {
                val json = kotlinx.serialization.json.Json { ignoreUnknownKeys = true }
                serializer = KotlinxSerializer(json)
            }
        }
    }
l
@Susheel That is not the configuration in the Gradle files. Any module that relies on the serialization plugin must apply it, or compilation will fail or produce unexpected results.
👍 1