I am doing a multiplatform project.
A part of my gradle file looks like this
...
kotlin {
jvm()
jvm("api")
js()
mingwX64("mingw")
sourceSets {
...
val jvmMain by getting {
dependencies {
implementation ("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
}
}
val jvmTest by getting {
dependencies {
implementation ("org.jetbrains.kotlin:kotlin-test")
implementation ("org.jetbrains.kotlin:kotlin-test-junit")
}
}
val apiMain by getting {
dependencies {
dependsOn(jvmMain)
}
}
val jsMain by getting {
dependencies {
implementation ("org.jetbrains.kotlin:kotlin-stdlib-js")
}
}
...
}
}
Now in the commonsMain sources I get an IDE error (red underline) that says "expected class Sample has no actual declaration in apiMain", but apiMain depends on jvmMain which has the actual declaration.
I don't think I need an actual declaration in apiMain since I already have one in jvm.
Should I take a different approach in setting-up my source sets?
Anyway the project compiles fine and I can run apiMain, but the IDE error really annoys me.