-
Notifications
You must be signed in to change notification settings - Fork 569
Execution failed for task ':compileKotlinAndroidNativeArm32'. when using coroutines for native targets androidNativeArm32/androidNativeArm64 #3914
Comments
Hello! The problem here is that the coroutines library is not being distributed for this target for now. Please see this issue for further details. |
It's very very sad, cause I chose this language (Kotlin/Native) to implement a big part of my projects and make those cross-platform. |
As can be found in the issue above, this problem comes from another library that coroutines depend on. I cannot give any ETA right now, but as you can see, there is some community interest here. You can also participate in the discussion there, increasing its priority. |
We have some unique algorithms and their implementations, that's why we need a Kotlin native to hide this part as separated SO libraries. It would makes a native source code more flexible, cause it would be really cross-platfomed and compilable without any modifications on iOS/MacOS/Linux/Andoid/Windows. Otherwise, e.g. for Android there is no problem to reverse APK and recompile it. Why native android targets still stay aside, but for other platforms coroutines works as a neotemlemoy part of a native Kotlin? I search a new possibility to move from C++ to another more flexible and modern language e.g. Kotlin, and the first requirement is a real cross-platformed for a native code. I thought Kotlin can help me on that case, but for now C++ still takes a lead. Hope it will changed as soon as possible. |
Closing as duplicate of Kotlin/kotlinx.coroutines#812. |
a) Yesterday I tried to use a coroutines for targets androidNativeArm32/androidNativeArm64, but it doesn't works. For iOS/MacOS/Linux it works fine.
b) For android native targets I'm using implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.+"), but if I change it to another version, e.g. 1.2.2, or try to use implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-android:1.3.+") some error occurs:
"...src/main/test.kt: (5, 16): Unresolved reference: coroutines"
"...src/main/test.kt: (6, 16): Unresolved reference: coroutines"
"...src/main/test.kt: (11, 5): Unresolved reference: runBlocking"
Build machineOS: MacOS
Kotlin/Native 1.3.61
==== build.gralde.kts part: =====
sourceSets {
val commonMain by getting {
kotlin.srcDirs("./src/main")
dependencies {
implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.+")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.+")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-common:1.3.+")
}
}
=== Log for A) part ===:
Execution failed for task ':compileKotlinAndroidNativeArm32'.
========== Sample to compile test.kt=============
package test
import kotlin.text.*
import kotlin.native.concurrent.*
import kotlinx.coroutines.*
import kotlinx.coroutines.channels.*
@kotlin.ExperimentalStdlibApi
fun main(args: Array)
{
runBlocking {
}
}
The text was updated successfully, but these errors were encountered: