Aaron Barsky
12/12/2022, 4:57 PM/Users/abarsky/AndroidStudioProjects/KotlinMultiplatformSandbox/build/ios/Debug-iphonesimulator/iosApp.app
Uncaught Kotlin exception: kotlin.native.IncorrectDereferenceException: illegal attempt to access non-shared <object>@3d723a8 from other thread
at 0 shared 0x10375ea73 kfun:kotlin.Throwable#<init>(kotlin.String?){} + 95
at 1 shared 0x103757f93 kfun:kotlin.Exception#<init>(kotlin.String?){} + 91
at 2 shared 0x1037581c7 kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 91
at 3 shared 0x10376a393 kfun:kotlin.native.IncorrectDereferenceException#<init>(kotlin.String){} + 91
at 4 shared 0x10376ce9b ThrowIllegalObjectSharingException + 415
at 5 shared 0x103b0a02f _ZN12_GLOBAL__N_128throwIllegalSharingExceptionEP9ObjHeader + 27
at 6 shared 0x103b0b5f7 _ZN12_GLOBAL__N_136terminateWithIllegalSharingExceptionEP9ObjHeader + 11
at 7 shared 0x103b0b7a7 _ZNK27BackRefFromAssociatedObject3refIL11ErrorPolicy3EEEP9ObjHeaderv + 231
at 8 shared 0x103b0a837 _ZN12_GLOBAL__N_111toKotlinImpEP11objc_objectP13objc_selectorPP9ObjHeader + 51
at 9 shared 0x103b011ab Kotlin_Interop_refFromObjC + 111
at 10 shared 0x1039e2cbb _696f2e6b746f723a6b746f722d636c69656e742d64617277696e_knbridge101 + 207
at 11 shared 0x103acb7cb _696f2e6b746f723a6b746f722d636c69656e742d64617277696e_kncfun103 + 79
at 12 CFNetwork 0x1049e37cf /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/CFNetwork.framework/CFNetwork + 47055
at 13 Foundation 0x105e4f8d7 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 15
at 14 Foundation 0x105e4f7cb -[NSBlockOperation main] + 99
at 15 Foundation 0x105e524f3 __NSOPERATION_IS_INVOKING_MAIN__ + 11
as the httpClient line is executed
@Throws(Exception::class)
suspend fun greeting(): String {
val rockets: List<RocketLaunch> =
httpClient.get("<https://api.spacexdata.com/v4/launches>").body()
Here are my plugin versions
plugins {
//trick: for the same plugin versions in all sub-modules
id("com.android.application").version("7.3.1").apply(false)
id("com.android.library").version("7.3.1").apply(false)
kotlin("android").version("1.7.10").apply(false)
kotlin("multiplatform").version("1.7.10").apply(false)
}
which were setup automatically for me when I made a new Kotlin Multiplatform App from within Android studio. https://kotlinlang.org/docs/multiplatform-mobile-create-first-app.html
Running XCode 14.. Is there a complete project I can download to make sure it's not a mistake typing in the tutorial code?hfhbd
12/12/2022, 7:48 PMAaron Barsky
12/12/2022, 9:44 PM1.7.10
to 1.7.20
fixed it. Thanks.