Hi all. I'm trying out the multi-platform feature ...
# announcements
b
Hi all. I'm trying out the multi-platform feature and I am getting the following error.
Error:(3, 1) Kotlin: The feature "multi platform projects" is experimental and should be enabled explicitly.
I cannot find any documentation on where to enable multiplatform build. I tried
Copy code
kotlin {
    experimental {
        multiplatform 'enable'
    }
}
but this doesn't work. Anyone run into this issue?
c
Take a look at docs here: https://kotlinlang.org/docs/reference/multiplatform.html And a small favour: please post code in code blocks
Also here is a sample project: https://github.com/hhariri/kotlin-mpp-sample
If you look at the
build.gradle
file you'll find explicitely applied
kotlin-platform-*
plugins. Probably you're missing those
b
I looked through my build files and all plugins are using the appropriate kotlin-platform-*. I will try to do a simple sample project to see where I went wrong.
Reporting back. I have built a simple example targeting just the jvm. The plugins were not the problem. Due to how I was launching the application, via the TornadoFX plugin, I was receiving the wrong error messages. My real problem was
Duplicate JVM class name 'us/nightware/kmod/DateTimeKt'
. So I was creating a class DateTime at the same level in the same named file. I moved the common DateTime to a file called
PlatformCommon.kt
and it runs without errors.
c
Good to hear you fixed it 🙂