Hello! What could be the problem that the JVM mod...
# multiplatform
p
Hello! What could be the problem that the JVM module unresolved reference from Multiplatform module ?
shared/build.gradle.kts
in the tread:
Copy code
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget

plugins {
  kotlin("multiplatform")
  kotlin("native.cocoapods")
}

version = "1.0"

kotlin {
  val iosTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
    if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
      ::iosArm64
    else
      ::iosX64

  iosTarget("ios") {}
  jvm()

  cocoapods {
    summary = "Some description for the Shared Module"
    homepage = "Link to the Shared Module homepage"
    ios.deploymentTarget = "14.1"
    frameworkName = "shared"
    podfile = project.file("../sample-ios/Podfile")
  }

  sourceSets {
    val commonMain by getting
  }
}
a
p
most likely yes
a
The workaround is to use
kotlin-multiplatform
plugin with the only target
jvm
p
yes, but no quite
Thank you, Arkadii!
s
Can you check if the issue still exists with latest Gradle plugin version and Intellij 2021.1?
p
Reproduce it in IntelliJ IDEA 2021.1 with gradle plugin
Copy code
org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.0-RC
m
The workaround is to use 
kotlin-multiplatform
 plugin with the only target 
jvm
This works for both my backend and Desktop targets
p
yep, it works
j
@Sebastian Sellmair [JB] this was resolved in 2021.1, a regression?
I have to recheck it again
s
Can you check if this happens also with 1.4 or 1.5.M*? 🙄 It seems to be a regression. I updated the Gradle Plugin to current master in our ide integration tests and see one related test failure 😢
j
I will try in a few hours :)
👀 1
s
Tests are fixed. Nothing broke there. If this still reproduces, and you've got a sample project, then I would absolutely have a look on this on Monday 😊
p
Opened a sample project https://github.com/ppav/kmm_test
s
Thanks a lot! I hope being able to work on it before my vacation on 05.05, but no promises given!
Unfortunately, I did not yet make it. @atyrin, would you mind looking into the sample project?
j
Better late than never. @Sebastian Sellmair [JB] I tried in a project which uses Kotlin 1.5.0, IDEA 2021.1.1, Kotlin IDEA plugin 2110-1.4.32-release-IJ142.27, and it is working without problems when a JVM module uses code from common code in a multiplatform module
s
Thank you very much 🥰 So there is no issue current releases?
j
with my combination, no
I havent tested IDEA 1.5.0 plugin, I am waiting until it is released
p
you really fixed it