Our KMP has multiple modules. For Android each mod...
# multiplatform
a
Our KMP has multiple modules. For Android each module exports an AAR. For iOS we are currently combining all modules in a single framework. Would be possible to have a framework per module ?
p
Do-able in theory but not recommended. Forgot what part of the docs I read that but probably there are articles talking about that already. If using compose in the modules you will have to do static compilation which would include the compose binary in your binary. It will result in bloating size and errors compiling/linking in the final consumer App due to duplicate symbols and such. If not using compose, perhaps is not so traumatic, assuming all modules do dynamic compilation but I still think KMP runtime will be duplicated in the module binarirs and will fall into the same compiling/linking problems.
Umbrella is the way to go 😺
a
Thanks
a
Does umbrella scale to tens or hundreds of modules? Seems like a large bottleneck imo
💯 1
p
It is a bit of a bottleneck right. In terms of how many modules it can handle without blowing up in size and compilation time. I really haven't had the chance to experience it, all my pet projects are kinda small. But definitely a point that deserves improvement
👍 1
I spent sometime looking for this subject in the official docs, bc I swear having read a detailed explanation long ago. Anyhow, I don't think to find that page anymore but I do see this section where JB recommends the use of the umbrella module. Perhaps they updated the documentation. https://www.jetbrains.com/help/kotlin-multiplatform-dev/multiplatform-project-configuration.html What surprises me is that there seems to be some improvement in this sector. Checking these two links below, it seems that importing multiple
.frameworks
inclusion is not an issue anymore: https://github.com/JetBrains/kotlin-native/issues/2423 https://touchlab.co/multiple-kotlin-frameworks-in-application
very nice 1
a
Thank you!
👍 1
117 Views