I have been stuck at this issues for days. :cry: I am building an app using Compose Multiplatform. I...
j
I have been stuck at this issues for days. 😢 I am building an app using Compose Multiplatform. I have added two third party Compose UI libraries in
build.gradle.kts
(shared) like the screenshot below - both of them written in Kotlin + Compose. However, I failed to find the components and public func from those libraries in my actual class. I even couldn’t manually import them. Did I miss anything regarding adding libraries into Compose Multiplatform project ? 🙏 Thanks so much in advance!
p
Is that library supporting all your targets?
Otherwise you have to place it in the specific target dependencies
j
Thanks for helping! Did you mean the
sourceSet
in gradle? I also put them there like this as below:
p
Yes, if is an Android only library goes in the androidMain, other platforms likewise
j
Aww, yes I put them under
androidMain
and it works! Does it mean this Compose UI library won’t work if I run my app on iOS emulator?
p
Right
You have to find one for iPhone. Then in common code use an abstraction with expect / actual. Each platform will have its actual implementation
j
I see! You really saved my day! Thanks so much! thank you color
👍 1