https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

ankushg

10/29/2018, 6:31 PM
Another multiplatform related bug/question: I've defined a file
utils/TimeUtils.kt
in my
commonMain
source set, with a top-level
expect fun getCurrentTime(): Long
declaration. I've also defined a file
TimeUtils.kt
in my
jvmMain
source set, in the same
utils
package, with an
actual fun getCurrentTime(): Long = System.currentTimeMillis()
. Attempting to build this project is giving me an error:
Duplicate JVM class name 'utils/TimeUtilsKt' generated from: package-fragment utils, package-fragment utils
Is this supposed to be allowed? Using
@file:JvmMultifileClass
doesn't fix the issue either... Do the files just have to be named differently altogether?
i

ilya.gorbunov

10/29/2018, 6:43 PM
That's a known issue (https://youtrack.jetbrains.com/issue/KT-21186) and the workaround is to rename one of these files.
a

ankushg

10/29/2018, 6:49 PM
awesome, thanks so much for this. I must have glossed over that issue because I assumed this was related to new MPP but the issue is relatively old and just now resurfacing 🙂