Hi 👋 I have an SDK with several internal modules, but the user of the SDK doesn’t need to know about them.
On Android, I can use things like fat AAR or fused libraries to merge all modules into one, run R8, and publish a single artifact.
In KMP, what is the best way to do this?
Right now, to make my code compile, I mark the internal modules as compileOnly in the main module. On Android this works fine because I can publish a single fat AAR. But on iOS, I have to use implementation for the internal modules, and the result is that my iOS build ends up with multiple modules.
This creates a problem: in common code, my library doesn’t work properly, and the consumer has to write extra code to connect iOS, common, and Android. The only workaround I see is to create another module myself that handles this.
So my questions are:
Do we really need something like a fat KLIB?
Or is it better to avoid modularization and just have a single module library?
Because with multiple modules, obfuscation gets harder (public APIs must stay visible), while with fat AAR everything is merged before obfuscation.