https://kotlinlang.org logo
#announcements
Title
# announcements
b

bkenn

12/04/2017, 7:59 PM
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

Czar

12/04/2017, 8:35 PM
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

bkenn

12/04/2017, 8:51 PM
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

Czar

12/05/2017, 7:02 AM
Good to hear you fixed it 🙂
2 Views