Closed atsushieno closed 2 years ago
I think I figured out why this problem happens.
ksp gradle plugin has some hacky configuration hack to populate ksp targets for each existing target. That part of the code does not blend with standard way of defining targets in JetBrains Kotlin Multiplatform project structure that is generated by IDEA default template, which is like:
val nativeTarget = when {
hostOs == "Mac OS X" -> macosX64("native") { ...
hostOs == "Linux" -> linuxX64("native") { ... }
isMingwX64 -> mingwX64("native") { ... }
else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
}
They define native targets in the name of "native"
. On the other hand, what Google devs did on their examples/multiplatform
:
linuxX64() { ... }
// requires Android SDK
androidNativeX64() { ... }
// requires Android SDK
androidNativeArm64() { ... }
mingwX64()
Looking totally different. It is quite impractical and lacks common source set (nativeMain
) specification. It is most likely Google's responsibility to get things working along with how JetBrains' native commonizer works.
The latest native build is on native-issue3
branch.
It is now filed as a ksp issue https://github.com/google/ksp/issues/737
fixed at 1ab9599.
It has been known when I had been stuck at https://github.com/atsushieno/augene-ng/issues/5 but while that issue is gone it's still there:
To workaround the problem, disable native build again (disable native targets in
kotractive/build.gradle.kts
).