Up to now I've used Ktor `3.0.0-wasm1` version in ...
# webassembly
j
Up to now I've used Ktor
3.0.0-wasm1
version in isolated module but trying it now in common code in a KMP project.....it seems to mostly work but on iOS I'm getting following....I have added
atomicfu
in dependencies but perhaps might be using wrong version (also using coroutines
1.8.0-RC
)
Copy code
w: skipping /Users/joreilly/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iossimulatorarm64/0.23.1/577e14084dac4dbadcaf86db01f359b4939f5d5a/atomicfu-cinterop-interop.klib. The library versions don't match. Expected '0.22.0-wasm2', found 'unspecified'
b
cc @Igor Yakovlev
@John O'Reilly please try to specify explicitly atomicfu as dependency, as workaround
j
Yeah, I have that but still getting that error.....perhaps using wrong version.....what version should I have?
have this right now
Copy code
implementation("org.jetbrains.kotlinx:atomicfu:0.23.1")
i
I made a simple project and for me seems everything works well. Could you please to send me a small repro to check it on my side? (please notice, that ktor you use is not published in the main channel yet and its highly experimental).
j
will do, is that the version of atomicfu you're using btw?
could you also share
commonMain
dependencies you have there?
i
Copy code
val commonMain by getting {
    dependencies {
        implementation("io.ktor:ktor-client-core:3.0.0-wasm1")
        implementation("io.ktor:ktor-client-cio:3.0.0-wasm1")
    }
}

val commonTest by getting {
    dependencies {
        implementation(kotlin("test"))
    }
}
j
ok, so you didn't need to specify atomicfu dependency explicitly?
(when using 1.8.0-RC of kotlinx coroutines)
i
this is a bug with dependency for native targets, which is not connected with wasm or ktor
j
I see issue here then if running say (used kmp.jetbrains.com to generate project)
Copy code
./gradlew :composeApp:compileKotlinIosSimulatorArm64
I thought maybe ktor was coming in to picture here due to some dependency it had on atomicfu (given
expected '0.22.0-wasm2'
in error above)
should be able to use https://github.com/joreilly/ClimateTraceKMP to reproduce error
a
@John O'Reilly Hi, did you fix it? I mention about it at KT-64111 issue
j
No, not yet
looks like same issue I'm seeing at least
a
@Igor Yakovlev @bashor Hello. I created a simple project and you can test this error. Steps: 1. Go to gist and run a simple local Flask server (pip install flask & pip install flask_cors required) 2. Clone this repo and run any configuration except iOS to be sure that everything works fine a. For Desktop or Web configurations, change 10.0.2.2 to localhost b. I ran Android configuration on Emulator so I needed to use 10.0.2.2 proxy (because localhost provides emulator in this case) 3. Run iOS configuration P.S. Yes, I tried to specify explicitly atomicfu as dependency, but it doesn’t work
i
I published ktor
3.0.0-wasm2
into experimental repository which is not affected to this issue.
a
Copy code
Could not find io.ktor:ktor-client-core:3.0.0-wasm2
Could not find io.ktor:ktor-client-content-negotiation:3.0.0-wasm2
Could not find io.ktor:ktor-serialization-kotlinx-json:3.0.0-wasm2
j
@Igor Yakovlev it looks all right like it's only been published for some artefacts e.g. it's not there for https://maven.pkg.jetbrains.space/kotlin/p/wasm/experimental/io/ktor/ktor-client-core/
i
Yeah…something went wrong. I will republish it soon
👍 1
♥️ 1
j
I notice there's a
3.2.0
version there (and have been getting renovate notifications about that version today for various repos)....assume that's a mistake?
a
@John O'Reilly If you use Kotlin/Wasm you should use
:wasm
version everywhere it’s possible I guess if your project includes only Android, iOS and Desktop configurations, you can use the lates available version eg
3.2.0
By the way, you can easily check it by creating a simple project via Kotlin Multiplatform Wizard without a Web configuration
j
@Igor Yakovlev I'm seeing all needed
3.0.0-wasm2
ktor dependencies available now, thanks!
1
kodee welcoming 1
👍 1
And confirmed iOS client is building/running now as well.
1
.wasm 1
👍 1