Using version 1.11.1
I have a library that uses korio (it's awesome, thanks ;-) ), the plan being to use that library on Android and on the server. The dependency to korio in that library is declared in my build.gradle.kts as follows
kotlin {
sourceSets {
main {
dependencies {
implementation("com.soywiz.korlibs.korio:korio:1.11.1")
}
}
}
}
with the enableFeaturePreview("GRADLE_METADATA")
flag set in the settings.gradle.kts
My android project has the dependency declared via implementation("com.soywiz.korlibs.korio:korio-android:1.11.1")
When I run the tests that use the code I get the following error:
java.lang.NoClassDefFoundError: com/soywiz/korio/file/std/LocalVfsJvmKt
The code in my standalone library that the test bails on is something like:
// all korio related imports below
import com.soywiz.korio.async.toChannel
import com.soywiz.korio.file.VfsFile
import com.soywiz.korio.file.VfsOpenMode
import com.soywiz.korio.file.VfsStat
import com.soywiz.korio.file.std.createZipFromTreeTo
import com.soywiz.korio.file.std.toVfs
import com.soywiz.korio.stream.AsyncInputStream
import com.soywiz.korio.stream.asyncStreamWriter
import com.soywiz.korio.stream.write64LE
import com.soywiz.korio.stream.writeString
// other imports
class SomeFunctionality {
// other bits
suspend fun file(name: String, javaFile: java.io.File) {
val file = javaFile.toVfs() // error is from here
require(file.exists() && !file.isDirectory()) { "The file provided either does not exist or is a directory" }
// the functionality
}
// more bits
}
Weirdly, in the android code I add some code like println("DIR = ${theDir.toVfs()}")
and it prints out the path just fine.
Have you seen this behaviour before or any ideas how to remedy? I think I'm missing some multiplatform/gradle incantation somewhere
NB I've also tried without the flag set and the dependency declared via implementation("com.soywiz.korlibs.korio:korio:1.11.1")
in the dependencies block with the same resulting behaviour.