I created a new multiplatform project. The gradle build file was more bare-bones than I remember, but I proceeded and manually created the folder src/jvmMain/kotlin
and added some source files to it. Then I created a jvm
and jvmMain
sections in my build.gradle.kts
:
kotlin {
jvm { ... }
sourceSets {
val jvmMain by getting {
dependencies { ...
It all seemed to work; I was able to compile and run some Kotlin code. Then I restarted in IntelliJ and it again chokes and gives me this:
Please initialize at least one Kotlin target in ‘DemoProject’ (:)'.
Read more https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#setting-up-targets
That link is not helping - it leads to general MPP docs. I think I did set up a target, so what is it complaining about? Is the jvm
block in the gradle file not initializing a target?