Hi, everyone, i have an app in kotlin multiplatfor...
# store
s
Hi, everyone, i have an app in kotlin multiplatform, but when im trying to use store I receive an error due to kermit (I have an dependency of kermit in my project specific 2.0.4) so I have this code in a repository
Copy code
private val store by lazy {
        StoreBuilder.from(
            fetcher = Fetcher.of {
// entity from remote source (suspend fun)
                Entity(
                    id = 0,
                    scannedToday = 0,
                    collectedToday = 0,
                    droppedOffToday = 0,
                    beingHandled = 0,
                )
            },
            sourceOfTruth = SourceOfTruth.of(
                reader = appDatabase.dao()::get,
                writer = { _, entity -> appDatabase.dao().insert(entity) },
                delete = appDatabase.dao()::delete,
                deleteAll = appDatabase.dao()::wipe
            )
        ).cachePolicy(
            MemoryPolicy.builder<Any, Any>()
                .setMaxSize(1)
                .setExpireAfterWrite(20.seconds)
                .build()
        )
            .build()
    }
If i run android app all is going well but in IOS as soon as the class that contains the val is initialized i got this error
Copy code
io.ktor.client.plugins.HttpRequest$1@61240950 thread:  error: Parent job is Cancelling]
kotlin.native.internal.IrLinkageError: Constructor 'CommonWriter.<init>' can not be called: No constructor found for symbol 'co.touchlab.kermit/CommonWriter.<init>|<init>(){}[0]'
also I notices that if I downgrade my dependency to 1.2.2 (the one is used in store5) is solved
plus1 2
f
plus1 I had this exact problem few days back
m
Hey all, thanks for surfacing. Will take a look
b
I’m experiencing this issue also. Is this tracked anywhere or has someone found a workaround? I tried adding
export("co.touchlab:kermit:2.0.4")
to my ios target configs and still nothing 😕
m
Hey all, apologies for the very slow response. Very busy few months. I will try to take a look this weekend. Would love help though if someone can take a look
Will try to get the next alpha out today, some of the tests are failing
b
Thanks @Matthew Ramotar
m