KamilH
10/09/2020, 6:57 AMMockEngine
and it works on the JVM and JS targets, but fails on iOS with following message:
kotlin.Error: Ktor native HttpClient requires kotlinx.coroutines version with `native-mt` suffix (like `1.3.9-native-mt`). Consider checking the dependencies.
Where should I add those dependencies? I though I should add it in iosTest
like that:
sourceSets {
val iosTest by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9-native-mt")
}
}
}
but it doesn’t help. Adding to iosMain
also doesn’t change anythingclass HttpClientTest {
private val httpClient: HttpClient = HttpClient(MockEngine) {
engine {
addHandler {
respondOk()
}
}
}
@Test
@JsName("testResponse")
fun `test response`() = runTest {
val response = httpClient.get<HttpResponse>("<http://www.google.com|www.google.com>")
assertEquals(response.status, HttpStatusCode.OK)
}
}
e5l
10/09/2020, 7:04 AMKamilH
10/09/2020, 7:05 AMe5l
10/09/2020, 7:05 AMTijl
10/09/2020, 7:39 AMimplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9-native-mt!!")
1.3.9-native-mt-2
by now as welle5l
10/09/2020, 8:04 AMnative-mt-2
and any compatible with native version. There is runtime check for thatKamilH
10/09/2020, 8:46 AMe5l
10/09/2020, 10:21 AMNikolay Kasyanov
10/28/2020, 1:42 PMcommonMain
?Tijl
10/28/2020, 1:53 PMNikolay Kasyanov
10/28/2020, 1:56 PMKamilH
10/28/2020, 2:33 PMNikolay Kasyanov
10/28/2020, 2:33 PMAnvith
10/29/2020, 6:35 AM!!
)causes Intellij to break and all syntax highlighting to disappear since it cannot resolve the artifact, strangely though commandline works and generates stuff.
I ended using 1.3.9-native-mt-2
along side the gradle force flag for it to work perfectly with both
implementation(CommonDeps.coroutinesCore){
isForce =true
//newer gradle directive of 'strictly' doesn't work for some reason either
}
KamilH
10/29/2020, 6:46 AM1.3.9-native-mt!!
and it was working properly when integrated into Android app, but suddenly it stopped working. I spent some time investigating and I’ve found nothing about that. Changing to 1.3.9-native-mt-2
in Kotlin Multiplatform library solved an issue. So strangeTijl
10/29/2020, 11:46 AM