# multiplatform


03/18/2024, 9:31 AM
I was experimenting with KMM, and got a use case that I was looking at alot of threads and issues on issuetracker. Considering fully modularised existing iOS and Android apps, which heavily rely on modularisation for obvious reasons, and lets assume, that we want to extract out some common functionalities like error logging, analytics some common features (only the business logic) to the world of KMM so as to share code among both platforms. lets say we have KMM project/library that as multiple modules like,
which has the whole networking layer, model, which will then be used by another module
and so on. and then these modules can be consumed in the iOS and android apps. while building a framework/xcframework for iOS side, all of this would get packaged in single xcframework and while consuming in iOS side, we will end up, consuming unnecessary modules in the respective modules in iOS side. like a feature module might not auth module at all, but just error logger, but the framework will have all of it. are there any strategies or something that can be done in order to achieve this, I have gone through a few issues and open issues on youtrack. here
maybe they can be extracted out to 3 separate frameworks instead on one framework that contains all, and respective framework can be used in the necessary modules in iOS app.
as the above approach ends up having a ton of duplicate dependencies in each framework, we can probably have something like extract core as its own framework and the respective frameworks depends on it, this seems more unreal, but not super sure though.
I am also inferring from
this, that these can be extracted out as native binaries, and then can be added to native targets, but not super sure about it though.