Shan
11/25/2019, 1:52 AMUnresolved Reference
error? Project structure is like
proj
|_ commonMain
|_ commonTest
|_ jvmMain
|_ kotlin
|_ com.my.package.keys
|_ KeyPairJ.java
|_ jvmTest
|_ kotlin
|_ com.my.package
|_ KeyPairTest
Getting this error every time I try to run a test:
e: ../src/jvmTest/kotlin/com/my/package/KeyPairTest.kt: (13, 19): Unresolved reference: KeyPairJ
My build file is set up like so
//ommitted some things
kotlin {
jvm()
js()
sourceSets {
//omitted some stuff
val jvmMain by getting {
dependencies {
implementation(kotlin("stdlib-jdk8"))
//other stuff- ktor, coroutines, etc.
}
}
val jvmTest by getting {
kotlin("test")
kotlin("test-junit")
}
}
}
Very confused here.. I can call code from commonMain
fine, just not from jvmMain
🤔russhwolf
11/25/2019, 12:43 PMjvm { withJava() }
instead of jvm()
. See https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html#java-support-in-jvm-targetsShan
11/26/2019, 4:18 AMwithJava()
but did not put the java files into their own java
directory. That did the trick. Thank you!