Tim Ortel
08/20/2022, 9:19 PMUncaught Kotlin exception: kotlin.native.concurrent.InvalidMutabilityException: mutation attempt of frozen kotlinx.coroutines.internal.DispatchedContinuation
runBlocking {
withContext(Dispatchers.Main) {
suspendCoroutine { c ->
//handler is called from another thread.
val handler = { x -> c.resume(x) }
//Internally, schedules the work on another thread.
//Therefore, c.resume() fails, as c is frozen.
some_api_that_schedules_another_thread(handler)
}
}
}
Is there any way around of this. Changing the internal API is not possible.John O'Reilly
08/20/2022, 9:25 PMInvalidMutabilityException
errors.gradle.properties
kotlin.native.binary.memoryModel=experimental
kotlin.native.binary.freezing=disabled
Trevor Stone
08/21/2022, 1:15 AM