Daniele Segato
12/03/2024, 4:50 PM'com.android.kotlin.multiplatform.library' and 'com.android.library' plugins cannot be applied in the same project.
Which one should I use? what are the drawbacks of using one or the other?
If I apply the com.android.library
I need to add androidTarget()
to the kotlin
configuration with multiplatform and I keep using the standard android
configuration.
However if I add the com.android.kotlin.multiplatform.library
I need to use androidLibrary { }
instead.
Android Studio generate multiplatform libraries with com.android.kotlin.multiplatform.library
.
If I recall I went with com.android.library
because with the other Android Studio wasn’t showing compose previews.
I’d really appreciate if someone could shed some light on this. I couldn’t find any documentation on this. Thank youScott Lanoue
12/03/2024, 9:37 PMplugins {
id("com.android.library")
kotlin("multiplatform")
}
This allows me to create a KMP library with an android targetScott Lanoue
12/03/2024, 9:38 PMtapchicoma
12/04/2024, 1:03 PMcom.android.kotlin.multiplatform.library
is a new plugin from Google for KMP/Android target. Eventually "com.android.library" will stop working in KMP, but it will be not soontapchicoma
12/04/2024, 1:05 PMDaniele Segato
12/04/2024, 1:11 PMcom.android.kotlin.multiplatform
is the future. Right now they are more or less equivalent. Right now this plugin doesn't work with previews in android studio, I should check it periodically to do the switchtapchicoma
12/04/2024, 1:24 PMDaniele Segato
12/05/2024, 7:56 AM