hi everyone, did anyone face with issue on syncing...
# compose
e
hi everyone, did anyone face with issue on syncing the dependency for Android platform specifically for kmp compose when it doesn't let me download the desired libraries. For example I added the implementation:
androidx.compose.foundation:foundation
, but after done syncing I always only can get
androidx.compose.foundation:foundation-android
it automatically changed to android version of that library not sure where did I go wrong, I'm new to compose kmp, thank you everyone!
w
how many targets you've set? just android?
e
I'm setting Android, iOS, wasmJs, Desktop in my project, trying to do separate native UI for Android
a
This is how Kotlin Multiplatform libraries work. What's the problem here?
e
I created kmp project which have used shared compose UI and supported for android, ios, wasmjs, now I got request to separate the native UI for android and use a local aar UI library, the aar library is using the FlowRow which belong to
androidx.compose.foundation:foundation-layout
, but when I tried to add
implementation("androidx.compose.foundation:foundation-layout:x.x.x")
into the
androidMain
source set I only can
get androidx.compose.foundation:foundation-layout-android
a
Yeah as I said that’s how Kotlin Multiplatform libraries work. You should be able to use
FlowRow
, so what’s the problem?
e
oh yes you're right Albert, just checked again and I'm able to use
FlowRow
in native Android UI, so the actual problem is when working on native Android UI part, I have to use a local aar UI library from client, in this aar they are using
FlowRow
I guess and when I use the UI components from this library I got this crash:
java.lang.NoSuchMethodError: No static method FlowRow(Landroidx/compose/ui/Modifier;Landroidx/compose/foundation/layout/Arrangement$Horizontal;Landroidx/compose/ui/Alignment$Vertical;ILkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/foundation/layout/FlowLayoutKt; or its super classes (declaration of 'androidx.compose.foundation.layout.FlowLayoutKt'
could the issue be the different version of compose foundation version I'm using and they are using from the aar library?
a
Exactly.
❤️ 1