I'm trying to use ktor 2.0 for a native app and getting an error:
Copy code
Uncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: Trying to access top level value not marked as @ThreadLocal or @SharedImmutable from non-main thread
at kfun:kotlin.Throwable#<init>(kotlin.String?){} (0x43c461)
at kfun:kotlin.Exception#<init>(kotlin.String?){} (0x435e6d)
at kfun:kotlin.RuntimeException#<init>(kotlin.String?){} (0x43600d)
at kfun:kotlin.native.IncorrectDereferenceException#<init>(kotlin.String){} (0x46606d)
at ThrowIncorrectDereferenceException (0x483fbe)
at CheckGlobalsAccessible (0x603112)
at kfun:io.ktor.client.engine.curl.<get-curlApi>#internal (0x8b15c7)