# multiplatform

Maurice Jouvet

10/06/2020, 8:20 PM
Does anyone as already had an issue with sqldelight encode with adapter? I'm trying to serialize a simple object, it's working fine on android, but crashes on ios....
Copy code
data class AccessModel(
    val isAccessible: Boolean = false,
    val conditions: List<ConditionModel>? = null

data class ConditionModel(
    val id: Int,
    val value: List<String>? = null,
    val min: Float? = null,
    val max: Float? = null
It's crashing here:
bindString(1, visibility?.let { database.FieldAdapter.accessModelAdapter.encode(it) })
Copy code
fun accessModelToString(item: AccessModel): String = Json.encodeToString(AccessModel.serializer(), item)
Copy code
val accessModelAdapter = object : ColumnAdapter<AccessModel, String> {
    override fun encode(value: AccessModel): String = SharedJSONConverter.accessModelToString(value)
Here the object that's crashing.


10/26/2020, 7:13 AM
maybe try #squarelibraries