Having problem with trying new multiplatform projects feature with 1.2.0-beta-31

I get this strange gradle error

Platform project project ‘:js’ implements non-common project project ‘:shared’ (apply plugin 'kotlin-platform-kotlin')

but there is no ‘kotlin-platform-kotlin’ plugin

:shared has

apply plugin: 'kotlin-platform-common'
dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-common:${versions.kotlinVersion}"
}

:js has

apply plugin: 'kotlin-platform-js'
dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-js:${versions.kotlinVersion}"
    implement project(":shared")
}

Is it not ok to have expect/actual multiplat projects at same project level?

Is there helloworld sample for multiplatform projects?

Platform project project ‘:js’ implements non-common project project ‘:shared’ (apply plugin ‘kotlin-platform-kotlin’)

It’s just a typo in the message, should be 'kotlin-platform-common` which you seem have already applied.

There is no official example yet, but you can take a look at this repo: GitHub - jstuyts/kotlin-multiplatform-recipes: Recipes for building multi-platform Kotlin modules..
And this one is already upgraded to Kotlin 1.2-beta: GitHub - JakeWharton/Reagent: Experiments for future reactive libraries.

Looks like i have found incompatibility in your plugin check in KotlinPlatformImplementationPluginBase.
It seems mixing ‘apply’ gradle syntax and plugin block does something unexpected to this code.
This will always fail check:

plugins {
    id "com.moowork.node" version "1.0.1"
}
apply plugin: 'kotlin-platform-js'

Note how check fails for common project, but binary plugin/script plugin is applied in js one

I have created a branch that has been switched to the new syntax. Simply replacing header and impl was all it took: syntax-1.2

1 Like

@Konstantin-Khvan thank you for the investigation. Unfortunately, I wasn’t able to reproduce it by adding this plugins block to a js project.

I’ve opened an issue about that: https://youtrack.jetbrains.com/issue/KT-20634
Could you attach some minimal project that reproduces it there?

I have attached minimal project with reproducible issue. Good luck fixing classpath/classloaders bugs in groovy/gradle :smiley: