Can kotlin/jvm module use kotlin/native module?

I created a simple project:

– wrapper project with that includes two subprojects
– a kotlin/native (using multiplatform plugin) library that I want to export to DLL that I can later use in another language
– a kotlin/jvm app (using jvm plugin) in which I want to use my library.

motivation is simple: I want to make a library that I’ll later use in another cpp project, but I also want to write an example, standalone app in kotlin that uses this llibrary.

I made a simple Greeter class in the lib that returns a string. I made my jvm project depend on the lib with `implementation(project(“:mylib”))`, but even though the code completion and intellisense work work, running the jvm project results in ClassNotFoundException for the Greeter. What am I doing wrong? Is there no way to use kotlin/native subproject in kotlin/jvm project? Or did I forget to setup dependencies in gradle somehow?

submitted by /u/T3sT3ro
[link] [comments]