Hey there all, I’ve been putting together a multip...
# multiplatform
b
Hey there all, I’ve been putting together a multiplatform project that will support atleast 3 different products for my company across mobile platforms. I’ve got android working no problem, but today I was working on implementing my iOS portion and I’m running into an issue I am struggling to handle. I assume this is due to my not having any experience in iOS. The app will work with non-ktor code I have everything working up to producing the framework and being able to reference it in code. When I attempt to do anything with ktor for my network, I receive a
EXC_BAD_ACCESS (code=1, address=0x8)
in reference to
ktor_mutex_create
My versions and implementations: top build.gradle
Copy code
buildscript {
    ext.kotlin_version = '1.3.31'
    ext.coroutines_version = '1.2.1'
    ext.klockVersion = "1.4.0"
  
    ext.serialization_version = "0.10.0"
    ext.ktor_version = '1.1.4'

    ext.dokka_version = '0.9.17'
        dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"

        classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokka_version"

        classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04'

        classpath "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-test-common:$kotlin_version"
        classpath "org.jetbrains.kotlin:kotlin-test-annotations-common:$kotlin_version"
    }
common build.gradle
Copy code
iOSMain.dependencies {
            api kotlin('stdlib')
            implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:$coroutines_version"
            implementation "io.ktor:ktor-client-ios:$ktor_version"
            implementation "io.ktor:ktor-client-json-native:$ktor_version"
            implementation "io.ktor:ktor-client-logging-native:$ktor_version"
            implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-native:$serialization_version"
        }
The last reference it talks about is
Copy code
kfun:kotlinx.cinterop.<get-rawValue>@kotlinx.cinterop.CPointer<#STAR>?.()ValueType at Types.kt
this is in reference to
utils.ktor_mutex_create
Well I tracked this down to have to do with the
install(HttpCookies)
portion of starting ktor.
There seems to also be an issue on ktors page about this, and I didn’t realize that it was the same as the common platform issue I’ve also found: https://github.com/ktorio/ktor/issues/1187
o
@e5l ^^
e
Hi @Benjamin Charais, the issue fixed in master and will be available in the next minor release.
b
@Leonid Nice! Thanks for the quick turn around, I know this issue was recently brought up, and initially I didn’t even realize it was coupled with the same issue I was dealing with elsewhere.