{
  "id": 3354689,
  "title": "I inspected my KMP iOS export header 61% of it was dead weight. Here’s what I found and built",
  "url": "https://urgent.news/2026/08/25/i-inspected-my-kmp-ios-export-header-61-of-it-was-dead-weight-heres",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-25T21:27:46.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/siddhantpanhalkar/i-inspected-my-kmp-ios-export-header-61-of-it-was-dead-weight-heres-what-i-found-and-built-3mef"
  },
  "original_language": "en",
  "account": "When creating an iOS app using Kotlin Multiplatform (KMP) or Compose Multiplatform, the generated Shared.h header can often reach 20,000+ lines. These exports may be unnecessary due to default public visibility in Kotlin, which leads to Objective-C class interfaces being generated for every public declaration in the shared module. This can include theme constants, dimension constants, and internal state models, even if the Swift code doesn't use them. To identify dead code, a Gradle plugin named kmprofiler was built. This plugin analyzes the generated Objective-C header, scans Swift source files, and highlights unused exports. The author of kmprofiler noticed that 61.4% of the exports in their app (Framed) were unused. By making certain files internal and adjusting visibility, they were able to remove over 10,000 lines from the header and reduce the compiled object binary by 5.7 MB. The kmprofiler plugin is available on the Gradle Plugin Portal and can be applied to a shared module's build.gradle.kts file. To use it, run the analyzeKmprofiler task, which generates a report with summary information about the exported declarations and their usage.",
  "summary": "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…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}