Thread
#multiplatform
    h

    hiperbou

    3 years ago
    I'm adding the application plugin to the MPP 1.3.10 template 'Kotlin (JS Client/JVM Server)' and I always get the error "could not find or load main class 'sample.SampleKt' " Is there any example of using the application plugin in a multiplatform project?
    h

    hiperbou

    3 years ago
    Thanks Alexey, I found the error comparing my project with this one. In the default template aswell as in the documentation, uses "fromPreset(presets.jvm, 'jvm')" while in this example "presets.jvmWithJava" is used instead. So I switched this and is working as expected. I can't find this preset anywhere in the documentation. What's the difference between jvmWithJava and jvm?
    a

    Alexey Belkov [JB]

    3 years ago
    Quoting from https://github.com/h0tk3y/k-new-mpp-samples/blob/master/README.md:
    jvmWithJava is a preset for JVM that is coupled with the Gradle java plugin and defines a Kotlin compilation per Java source set; this preset is likely to be removed in the future once jvm gets support for compiling Java;
    See also related issues: https://youtrack.jetbrains.com/issue/KT-26256
    h

    hiperbou

    3 years ago
    As this README is labeled as obsolete, and even gives a link to the official documentation, I think that the preset should be listed here too, at least until it gets finally removed: http://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#supported-platforms
    a

    Alexey Belkov [JB]

    3 years ago
    This is almost certainly intentional. In any case, please leave a comment about it in
    <https://youtrack.jetbrains.com/issue/KT-26256>
    so we will have some kind of historical record of this decision.