Hi. With okio multiplatform, i’m running into a `o...
# squarelibraries
x
Hi. With okio multiplatform, i’m running into a
okio.IOException
.
Copy code
Uncaught Kotlin exception: okio.IOException: Operation not permitted
    at 0   PSCore                              0x10548be63        kfun:okio#errnoToIOException(<http://kotlin.Int|kotlin.Int>){}okio.IOException + 419
Looks like this is thrown from the encoder, which is here and looks like this
Copy code
override suspend fun encode(value: T?) {
  val parentFolder: Path? = path.parent
  if (parentFolder != null && !FILE_SYSTEM.exists(parentFolder))
    FILE_SYSTEM.createDirectories(parentFolder, mustCreate = false)
  if (value != null) FILE_SYSTEM.sink(path).buffer().use { json.encodeToBufferedSink(serializer, value, it) }
  else FILE_SYSTEM.delete(path)
}
Unable to reproduce this consistently. But seems to be more prevalent on physical devices compared to the simulator. Raised an issue here. Any idea whats wrong? 🤔
j
I replied on the issue with a hypothesis.