I inspected my KMP iOS export header 61% of it was dead weight. Here’s what I found and built
If you are building an iOS app with Kotlin Multiplatform (KMP) or Compose Multiplatform, you might have opened your generated Shared.h header at some point and wondered why it is 20,000+ lines long. I ran into this recently while optimizing one of my personal KMP apps. I kept seeing Objective-C classes generated for every single theme color, dimension constant, and internal state model, even though my Swift code never touched any of them. To get a clear picture of what was actually going on, I built a small Gradle plugin called kmprofiler . It parses the generated Objective-C header, scans your Swift source files, and highlights which exported declarations have zero call sites in Swift. The numbers on my app caught me off guard, but cleaning it up took just a few minutes. Why does Kotlin/Native export so much? In Kotlin, declarations are public by default. When targeting iOS, the Kotlin/Native compiler looks at every public class, top-level function, and property in your shared module and creates an Objective-C class interface and runtime method trampolines in the framework binary. The compiler cannot dead-strip these automatically because Objective-C relies on dynamic dispatch. It has to assume Swift or Objective-C could call them at runtime. If your UI is built with Compose Multiplatform or your Swift app only interacts with a couple of high-level bridge interfaces, most of those exported Objective-C wrappers end up being dead weight. The Audit: 459 Exports, 282 Unused When I ran kmprofiler on my app (Framed), it gave me this breakdown: ### 📊 KMP iOS Export Profile Export surface: 459 Kotlin declarations exported to Objective-C. No direct Swift call site found for 282 of them (61.4% uncalled). The unused exports mostly fell into three buckets: File Facades ( *Kt classes): Top-level properties in files like Dimens.kt (38 spacing constants) or Color.kt generated synthetic Objective-C classes like DimensKt with static getters for every single constant. Internal UI St