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

Reginald Louis

03/02/2024, 1:52 AM
Hello, so far KMP for desktop target application work for me. But once I try wasmJs target, all hell brake lose. For instance, I started from scratch. As soon I include this library for example (https://github.com/sksamuel/hoplite) I get flooded with this kind of error:
Copy code
- Variant 'sourcesElements' capability com.sksamuel.hoplite:hoplite-core:2.7.5 declares a component for use during runtime:
           - Incompatible because this component declares documentation and the consumer needed a library
           - Other compatible attributes:
               - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
               - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'wasm')
               - Doesn't say anything about org.jetbrains.kotlin.wasm.target (required 'js')
e

ephemient

03/02/2024, 1:54 AM
unsurprising, as that library is JVM-only
1
r

Reginald Louis

03/02/2024, 1:55 AM
Oh ok. I do you know? I'm still new to kotlin/jvm stuff
I taught that the whole point of KMP was to convert kotlin and/or java bytecode to wasm or something like that
e

ephemient

03/02/2024, 1:57 AM
Kotlin multiplatform is able to compile Kotlin code to other platforms and use interoperate with native libraries directly. it does not convert any existing Java bytecode
r

Reginald Louis

03/02/2024, 1:58 AM
Oh ok
e

ephemient

03/02/2024, 1:58 AM
you can see in https://repo1.maven.org/maven2/com/sksamuel/hoplite/hoplite-core/2.7.5/hoplite-core-2.7.5.module that only JVM is present in their publication (but also that's basically what the Gradle error is saying)
r

Reginald Louis

03/02/2024, 1:58 AM
I really taught it was a kind of AOT compiler
4 Views