Joaquim Ley
10/18/2020, 6:15 PM1.3.9-native-mt-2
it works on iOS but not for Android
• const val kotlinCoroutines = “1.3.9-native-mt-2”
With 1.4.0-M1
works for android but not iOS
• const val kotlinCoroutines = “1.4.0-M1"cy
10/18/2020, 6:16 PMJoaquim Ley
10/18/2020, 6:19 PMJoaquim Ley
10/18/2020, 6:25 PM1.3.9-native-mt-2
val commonMain by getting {
dependencies {
// Coroutines
implementation ("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}") {
version {
strictly(Versions.kotlinCoroutines)
}
}
(...)
}
• This works fine I can make http requests on iOS, I only have the kto-client-ios dependency on the iosMain
But if I try to build on Android with the same versions it won’t compile:
Execution failed for task ':android:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':android:debugRuntimeClasspath'.
> Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:{strictly 1.3.9-native-mt-2}.
Required by:
project :android > project :shared
> Cannot find a version of 'org.jetbrains.kotlinx:kotlinx-coroutines-core' that satisfies the version constraints:
Dependency path 'com.<--->:android:unspecified' --> 'com.'<--->:shared:1.0-SNAPSHOT' --> 'org.jetbrains.kotlinx:kotlinx-coroutines-core:{strictly 1.3.9-native-mt-2}'
Joaquim Ley
10/18/2020, 6:25 PMJoaquim Ley
10/18/2020, 6:31 PMkotlinCourtines
version to 1.4.0-M1
compiles just fine for both android and iOS, but when making a http request on the later, I get the freeze error:
Error(message=mutation attempt of frozen kotlinx.coroutines.ChildHandleNode@3516608)
Joaquim Ley
10/18/2020, 6:32 PMJoaquim Ley
10/18/2020, 6:34 PMconst val androidGradlePlugin = "4.2.0-alpha13"
const val kotlin = "1.4.10"
const val kotlinCompiler= "1.4.0"
const val kotlinCoroutines = "1.4.0-M1" // OR "1.3.9-native-mt-2"
const val ktor = "1.4.0"
const val kotlinxSerialization = "1.0.0-RC"
Joaquim Ley
10/18/2020, 6:51 PMJoaquim Ley
10/18/2020, 8:07 PMval commonMain by getting {
dependencies {
// Coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}") {
isForce = true
}
(...)
I spent a good 6hours to get this to finally working but now I only have swift on actual SwiftUI and I’m able to write ViewModels in kotlin for ios and androidJohn O'Reilly
10/18/2020, 8:15 PMstrictly
instead of isForce
....wasn't clear on this issue but are you saying that using that causes a problem?Joaquim Ley
10/18/2020, 8:16 PMJohn O'Reilly
10/18/2020, 8:46 PMstrictly
and isForce
should do the same thing as I understand it.....I had meant to update to the former as that seemed to be the recommended approach nowJohn O'Reilly
10/18/2020, 8:48 PM1.3.9-native-mt
of kotlinx coroutines btw primarily because of https://youtrack.jetbrains.com/issue/KTOR-1087Joaquim Ley
10/18/2020, 9:15 PM