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

eygraber

06/24/2021, 9:30 PM
If I have a library that is written entirely in common code, and I want to consume it from Android and JVM, do I need both targets, or
jvm
would be enough?
r

rnett

06/24/2021, 9:39 PM
I think jvm is enough (as long as it's 1.8?) since android can use general Java libraries. Stuff like Moshi and Ktor are just JVM. Would be nice to get conformation though
j

jw

06/24/2021, 10:01 PM
There's no reason to use the multiplatform plugin. Use the JVM plugin.
j

Javier

06/24/2021, 10:25 PM
Only
jvm
e

eygraber

06/25/2021, 2:28 AM
@jw sorry should have specified that I also want to consume it from other platforms (native, etc...). As a follow up, if the common code depends on another multiplatform library that has both
jvm
and
android
targets (like compose desktop), would my library also need both
jvm
and `android`targets, or will the consumer of my library be able to transitively pull in the right artifacts?
j

jw

06/25/2021, 2:28 AM
I see. And as others have said, just 'jvm' is all you need.