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

ushort

04/04/2020, 2:56 AM
Hello, was wondering how I'd go about creating a multiplatform project that targets android but also jvm for desktop. Basically sharing logic between android and desktop applications. I tried creating new jvm target with different name and came across some variant errors.
t

taso

04/04/2020, 12:14 PM
Why new jvm target? Jvm should work both for Jvm and also for Android.
If you need Android specific code, then you have
android
target
u

ushort

04/04/2020, 3:54 PM
Yeah makes sense. I had tried creating android target instead of jvm target and I got this error
Extension with name 'android' does not exist. Currently registered extension names: [ext, kotlin, kotlinTestRegistry, defaultArtifacts, reporting, sourceSets, java
I looked online and seems to be because I dont have kotlin-android plugin but that won't work with multiplatform plugin afaik since it gives me
Cannot add extension with name 'kotlin', as there is an extension already registered with that name.
.