is there a good explainer around on the difference...
# kotlin-native
e
is there a good explainer around on the difference between the
kotlin-multiplatform
plugin and the
kotlin-native-platform
plugin and when to use each?
g
I think someone can help you more. But I can tell you that I’m being able to use the
kotlin-multiplatform
plugin to build android, ios (native), javascript and jvm modules.
e
Yeah - i’m running into a bunch of conflicting gradle files in projects. I had it working with
multiplatform
before but now coroutines have decided to hate on me
g
As far as I know, you can use
kotlin-multiplatform
to all kind of projects. But you need to configure it property, inside the
kotlin
section. I think
kotlin-native-platform
is to just create native applications. I’ll suggest trying to change all of them to
Copy code
plugins {
	kotlin("multiplatform")
}

kotlin {
...
if you are using
build.gradle.kts
configuration files. But I’m afraid I can’t help you with coroutines in mpp projects. I’m using them on a jvm application only.
e
no worries!
s
Not sure if it has changed recently, pure Kotlin/Native projects aren’t well supported in IntelliJ. You can write them and you’ll get syntax highlighting and you can invoke a Gradle build but that’s about it. MPP is much better supported in IntelliJ.
e
yeah i’m using Android Studio so that makes sense.
s
I mostly use IntelliJ but when I’m doing any android ui, I switch over to AS. The GUI editor in IntelliJ doesn’t work so well with the AndroidX stuff. It’s kind of weird switching between Xcode, IntelliJ & Android Studio
o
better use
kotlin-multiplatform
plugin
👍 1
e
@olonho Thank you - what is the difference between the two (or is there a document somewhere which explains that)?
s
They both call konanc the k/n compiler in the end. The configuration syntax is a bit different between the two. Also multi platform let’s you share code between the different compiler back ends (jvm, JS, & Native).
e
ah, i think it’s that last piece that I was missing @Sam
kotlin-native-platform
is for just native, whereas
mutliplatform
supports (duh) multiple platforms.
Thank you!
👍 1