{"slug":"kmp-gradle-version-catalog","title":"kmp-gradle-version-catalog","summary":"Use when adding, upgrading or auditing dependencies and Gradle plugins in a Kotlin Multiplatform project - libs.versions.toml, [versions] [libraries] [plugins] [bundles], catalog entries for Room 3 (androidx.room3), the Koin compiler plugin or com.android.kotlin.multiplatform.lib","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-12-03T17:29:50.765396Z","repo":{"url":"https://github.com/Kushpawan/kmp-mobile-skills","stars":17,"forks":2,"license":"Apache-2.0","updatedAt":"2026-12-03T13:18:24Z"},"bodyHtml":"<hr>\n<h2>name: kmp-gradle-version-catalog\ndescription: Use when adding, upgrading or auditing dependencies and Gradle plugins in a Kotlin Multiplatform project - libs.versions.toml, [versions] [libraries] [plugins] [bundles], catalog entries for Room 3 (androidx.room3), the Koin compiler plugin or com.android.kotlin.multiplatform.library, \"Could not resolve\" or \"No matching variant\" for iosArm64, bumping the kotlin version key, one catalog shared across several repos (git submodule or published catalog), version drift, build-logic convention plugins, or includeBuild with dependencySubstitution for local library development.\nlicense: Apache-2.0\ncompatibility: Gradle 8+ Kotlin Multiplatform project. The drift script needs Python 3.11+ (standard library only, no network). iOS compile checks need macOS with Xcode. Optional lookups use the Android CLI with a running Android Studio, or klibs.io.\nmetadata:\ncategory: build\nplatforms: android, ios</h2>\n<h1>KMP Gradle version catalog and dependencies</h1>\n<p>Every version lives in exactly one version catalog, every dependency lands in the narrowest source\nset that needs it, and nothing goes into <code>commonMain</code> until you have confirmed it publishes iOS\nvariants. This skill edits the catalog; deciding which Kotlin, Compose Multiplatform, AGP, Gradle,\nJDK and Xcode versions go together is <code>kmp-toolchain-upgrade</code>.</p>\n<h2>When to use</h2>\n<ul>\n<li>Adding a library or Gradle plugin, or a bundle of them.</li>\n<li>\"Could not resolve\", \"No matching variant\" or a Kotlin metadata/ABI version error after adding one.</li>\n<li>Writing catalog entries for Room 3, the Koin compiler plugin or the Android-KMP library plugin.</li>\n<li>Changing a version key, including <code>kotlin</code> (then also check Xcode, Workflow B).</li>\n<li>Several repositories should share one catalog, or their versions have drifted.</li>\n<li>Extracting repeated build configuration into convention plugins.</li>\n<li>Developing a library locally while an app consumes it.</li>\n</ul>\n<h2>When not to use</h2>\n<ul>\n<li>Planning a Kotlin, Compose Multiplatform, AGP, Gradle, JDK or Xcode upgrade, or asking which of\nthose versions work together: <code>kmp-toolchain-upgrade</code>.</li>\n<li>Creating the module that will use the dependency: <code>kmp-feature-module</code>.</li>\n<li>Writing the platform abstraction around an Android-only library: <code>kmp-expect-actual</code>.</li>\n<li>Room or Koin code and setup beyond the catalog lines: <code>kmp-room-database</code>, <code>kmp-koin-di</code>.</li>\n<li>Migrating a project to AGP 9 as a whole: the AGP 9 migration skill in\n<a href=\"https://github.com/Kotlin/kotlin-agent-skills/tree/main/skills/kotlin-tooling-agp9-migration\">Kotlin/kotlin-agent-skills</a>.</li>\n<li>A failing build you have not yet diagnosed: <code>kmp-build-failure-triage</code> in this repo.</li>\n</ul>\n<h2>Step 0 — Read the project first</h2>\n<pre><code>ls gradle/libs.versions.toml 2&gt;/dev/null                       # default catalog location\ngrep -nE 'versionCatalogs|from\\(|includeBuild|dependencySubstitution|repositoriesMode' settings.gradle.kts\ncat .gitmodules 2&gt;/dev/null                                     # catalog shared as a submodule?\nls build-logic buildSrc 2&gt;/dev/null                             # convention plugins\ngrep -nE '^(kotlin|agp|composeMultiplatform|compose-multiplatform|ksp|room3?|koin[A-Za-z-]*)\\s*=' gradle/libs.versions.toml\ngrep -nE 'com\\.android\\.(application|library|kotlin\\.multiplatform\\.library)|androidx\\.room3?|insert-koin' gradle/libs.versions.toml\ngrep -rnE '\"[A-Za-z0-9_.-]+:[A-Za-z0-9_.-]+:[0-9]' --include='*.gradle.kts' . | grep -v /build/ | head\nxcodebuild -version 2&gt;/dev/null | head -1                       # macOS only: Xcode paired with Kotlin\n</code></pre>\n<table>\n<thead>\n<tr>\n<th>Record</th>\n<th>Why</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Catalog path: <code>gradle/libs.versions.toml</code>, a file imported in <code>settings.gradle.kts</code>, or a published <code>group:artifact:version</code></td>\n<td>Edit the real source of truth, not a copy</td>\n</tr>\n<tr>\n<td>Alias style: <code>ktor-client-core</code> (accessor <code>libs.ktor.client.core</code>) or camelCase</td>\n<td>New entries match existing ones</td>\n</tr>\n<tr>\n<td>Version key style: <code>kotlinx-coroutines</code> vs <code>kotlinxCoroutines</code></td>\n<td>Same</td>\n</tr>\n<tr>\n<td>Kotlin, AGP, Compose Multiplatform, KSP, Gradle versions, and the local/CI Xcode</td>\n<td>Decide compatibility before choosing a library version</td>\n</tr>\n<tr>\n<td>Android plugins in use: <code>com.android.kotlin.multiplatform.library</code> or the legacy <code>com.android.library</code> / <code>com.android.application</code> in KMP modules</td>\n<td>New entries follow the project's plugin; do not migrate as a side effect</td>\n</tr>\n<tr>\n<td>Room 2 (<code>androidx.room</code>) or Room 3 (<code>androidx.room3</code>); Koin with or without its compiler plugin</td>\n<td>Keep the existing generation unless the user asks to move</td>\n</tr>\n<tr>\n<td>Convention plugins</td>\n<td>Shared config belongs there, not copied into modules</td>\n</tr>\n<tr>\n<td><code>includeBuild</code> + substitution flags</td>\n<td>Local-library mode exists; know its property names</td>\n</tr>\n<tr>\n<td>Existing hardcoded versions in build files</td>\n<td>Report them; do not add more</td>\n</tr>\n</tbody>\n</table>\n<h2>Workflow A — Add a dependency</h2>\n<ol>\n<li><p><strong>Confirm the targets.</strong> For anything going into <code>commonMain</code>, confirm iOS variants exist:\nsearch <a href=\"https://klibs.io\">klibs.io</a>, read the library's docs, or check Maven Central for per-target\nartifacts (<code>&lt;artifact&gt;-iosarm64</code>, <code>&lt;artifact&gt;-iossimulatorarm64</code>):</p>\n<pre><code>G=io/ktor A=ktor-client-core\nfor t in iosarm64 iossimulatorarm64; do\n  printf '%-18s %s\\n' \"$t\" \"$(curl -s -o /dev/null -w '%{http_code}' \\\n    \"https://repo1.maven.org/maven2/$G/$A-$t/maven-metadata.xml\")\"\ndone   # 200 = published; androidx artifacts live on Google Maven instead\n</code></pre>\n<p>No iOS variant means the library is Android-only: put it in <code>androidMain</code> behind an interface\n(<code>kmp-expect-actual</code>). Done when you know which source set it belongs in.</p>\n<p>Optional lookups, when the user has them installed — never required:</p>\n<ul>\n<li>JetBrains' <a href=\"https://github.com/JetBrains/klibs-io/tree/release/skills/kmp-libraries-expert\">Kotlin Multiplatform Libraries Expert</a>\nskill (or the klibs.io MCP server, see <a href=\"https://klibs.io/ai\">klibs.io/ai</a>) for KMP target support\nand latest stable coordinates.</li>\n<li>The Android CLI's <code>android studio version-lookup</code> for the latest versions of Maven artifacts,\nAndroid versions and SDK tools. It connects to a running Android Studio; check its arguments\nwith <code>android studio version-lookup --help</code>. Gate on <code>command -v android</code>. See Google's\n<a href=\"https://github.com/android/skills/tree/main/devtools/android-cli\"><code>android-cli</code> skill</a>.</li>\n</ul>\n</li>\n<li><p><strong>Confirm the Kotlin version.</strong> A library compiled by a newer Kotlin than the project's can fail\nwith a metadata or ABI version error, especially on Kotlin/Native. Read its release notes for the\nKotlin it was built with. Kotlin compiler plugins (Compose compiler, serialization, the Koin\ncompiler plugin, SKIE) support a bounded Kotlin range — check theirs too. Done when the chosen\nversion supports the project's Kotlin.</p>\n</li>\n<li><p><strong>Add catalog entries.</strong> One <code>[versions]</code> key per version family, <code>version.ref</code> everywhere,\naliases in the file's existing style. Pin an exact stable version taken from the library's\nreleases page; never <code>+</code>, <code>latest.release</code> or a range unless the project already uses rich\nversions. Entry forms, naming rules, BOMs and rich versions are in\n<a href=\"references/catalog-syntax.md\">references/catalog-syntax.md</a>.</p>\n<pre><code>[versions]\nktor = \"&lt;exact version&gt;\"\n\n[libraries]\nktor-client-core = { module = \"io.ktor:ktor-client-core\", version.ref = \"ktor\" }\nktor-client-content-negotiation = { module = \"io.ktor:ktor-client-content-negotiation\", version.ref = \"ktor\" }\nktor-serialization-kotlinx-json = { module = \"io.ktor:ktor-serialization-kotlinx-json\", version.ref = \"ktor\" }\nktor-client-okhttp = { module = \"io.ktor:ktor-client-okhttp\", version.ref = \"ktor\" }\nktor-client-darwin = { module = \"io.ktor:ktor-client-darwin\", version.ref = \"ktor\" }\nktor-client-mock = { module = \"io.ktor:ktor-client-mock\", version.ref = \"ktor\" }\n\n[bundles]\nktor-common = [\"ktor-client-core\", \"ktor-client-content-negotiation\", \"ktor-serialization-kotlinx-json\"]\n</code></pre>\n</li>\n<li><p><strong>Wire it into the narrowest source set.</strong></p>\n<pre><code>kotlin {\n    sourceSets {\n        commonMain.dependencies { implementation(libs.bundles.ktor.common) }\n        androidMain.dependencies { implementation(libs.ktor.client.okhttp) }   // engine per platform\n        iosMain.dependencies { implementation(libs.ktor.client.darwin) }\n        commonTest.dependencies { implementation(libs.ktor.client.mock) }\n    }\n}\n</code></pre>\n<p>Use <code>api</code> only when the dependency's types appear in this module's public API (and therefore\nin an iOS <code>export</code>). Done when the module compiles for every target (Verify).</p>\n</li>\n<li><p><strong>Plugins.</strong> Add a <code>[plugins]</code> entry, declare it once in the root <code>build.gradle.kts</code> with\n<code>alias(libs.plugins.x) apply false</code>, then <code>alias(libs.plugins.x)</code> in the module. Catalog plugin\naliases cannot be used in <code>settings.gradle.kts</code>.</p>\n</li>\n<li><p><strong>Annotation processors (KSP).</strong> KMP needs one configuration per target, for example\n<code>add(\"kspAndroid\", libs.androidx.room3.compiler)</code>, <code>add(\"kspIosArm64\", …)</code>,\n<code>add(\"kspIosSimulatorArm64\", …)</code>, and <code>kspIosX64</code> if that target exists. A missing target either\nfails that target's compilation or, for processors whose output is looked up at runtime, fails\nonly when the app runs on that platform. Done when every declared target has a line.</p>\n</li>\n</ol>\n<h2>Catalog entries for Room 3, Koin and the Android-KMP plugin</h2>\n<p>Add only the entries the project needs, in its own alias style. Versions: the latest stable from\neach project's release notes (or the lookups above).</p>\n<pre><code>[versions]\nagp = \"&lt;exact version&gt;\"\nroom3 = \"&lt;exact version&gt;\"          # Room 3 line; Room 2 uses the separate androidx.room group\nsqlite = \"&lt;exact version&gt;\"\nkoin = \"&lt;exact version&gt;\"\nkoin-plugin = \"&lt;exact version&gt;\"    # own release line; not managed by koin-bom\n\n[libraries]\nandroidx-room3-runtime = { module = \"androidx.room3:room3-runtime\", version.ref = \"room3\" }\nandroidx-room3-compiler = { module = \"androidx.room3:room3-compiler\", version.ref = \"room3\" }\nandroidx-sqlite-bundled = { module = \"androidx.sqlite:sqlite-bundled\", version.ref = \"sqlite\" }\nkoin-bom = { module = \"io.insert-koin:koin-bom\", version.ref = \"koin\" }\nkoin-core = { module = \"io.insert-koin:koin-core\" }\n\n[plugins]\nandroid-application = { id = \"com.android.application\", version.ref = \"agp\" }\nandroid-kotlin-multiplatform-library = { id = \"com.android.kotlin.multiplatform.library\", version.ref = \"agp\" }\nandroidx-room3 = { id = \"androidx.room3\", version.ref = \"room3\" }\nkoin-compiler = { id = \"io.insert-koin.compiler.plugin\", version.ref = \"koin-plugin\" }\n</code></pre>\n<table>\n<thead>\n<tr>\n<th>Entry</th>\n<th>Rule</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>com.android.kotlin.multiplatform.library</code></td>\n<td>Ships with AGP: <code>version.ref = \"agp\"</code>. Shared KMP modules apply it; <code>com.android.application</code> goes only in the pure-Android app module (for example <code>:androidApp</code>). Under AGP 9 the KMP plugin no longer works with <code>com.android.application</code> or <code>com.android.library</code> in the same module, and Kotlin 2.5 warns on every AGP version. Moving a project over is the <a href=\"https://github.com/Kotlin/kotlin-agent-skills/tree/main/skills/kotlin-tooling-agp9-migration\">AGP 9 migration skill</a>, not a catalog edit</td>\n</tr>\n<tr>\n<td>Room 3 (<code>androidx.room3</code>)</td>\n<td>KSP only, one <code>ksp&lt;Target&gt;</code> line per target; needs a <code>SQLiteDriver</code> (<code>sqlite-bundled</code>); publishes no <code>iosx64</code> artifacts. Never keep <code>androidx.room</code> and <code>androidx.room3</code> side by side; moving from Room 2 is <code>kmp-room-database</code></td>\n</tr>\n<tr>\n<td>Koin compiler plugin</td>\n<td>Separate <code>koin-plugin</code> key, never <code>version.ref = \"kotlin\"</code> and not covered by the BOM. It is a Kotlin compiler plugin with its own supported Kotlin range: read its <a href=\"https://github.com/InsertKoinIO/koin-compiler-plugin/releases\">release notes</a> before bumping either. Setup: <code>kmp-koin-di</code></td>\n</tr>\n<tr>\n<td>build-logic needs a plugin as a library</td>\n<td><code>com.android.tools.build:gradle</code> (<code>agp</code>), <code>androidx.room3:room3-gradle-plugin</code> (<code>room3</code>), <code>io.insert-koin:koin-compiler-gradle-plugin</code> (<code>koin-plugin</code>), as <code>compileOnly</code> — see <a href=\"references/convention-plugins.md\">references/convention-plugins.md</a></td>\n</tr>\n</tbody>\n</table>\n<h2>Workflow B — Bump a version key</h2>\n<p>Change one key per commit and run the full Verify after each.</p>\n<ol>\n<li><strong>A library or its BOM:</strong> bump the one <code>[versions]</code> key; read the release notes for the Kotlin it\nneeds (Workflow A step 2). Done when Verify passes.</li>\n<li><strong><code>kotlin</code>, <code>agp</code>, <code>composeMultiplatform</code>, <code>ksp</code> or the Gradle wrapper:</strong> these depend on each other\nand on Gradle, the JDK and Xcode. Plan the order and the target versions with\n<code>kmp-toolchain-upgrade</code>, then make each catalog edit here. Catalog rules that always hold:\n<ul>\n<li>Kotlin Gradle plugin, Compose compiler (<code>org.jetbrains.kotlin.plugin.compose</code>) and the\nserialization plugin share <code>version.ref = \"kotlin\"</code>.</li>\n<li><code>material3</code>, <code>navigation-compose</code> and <code>lifecycle-*</code> under <code>org.jetbrains.*</code> have their own version\nlines; take them from the Compose Multiplatform release notes, not from the CMP version.</li>\n<li>KSP before 2.3.0 is versioned <code>&lt;kotlin&gt;-&lt;ksp&gt;</code>; 2.3.0 and later have their own line\n(<a href=\"https://github.com/google/ksp/releases\">KSP releases</a>).</li>\n<li>Kotlin compiler plugins outside the Kotlin release (Koin compiler plugin, SKIE) must list the new\nKotlin as supported.</li>\n</ul>\n</li>\n<li><strong>Whenever <code>kotlin</code> changes, check Xcode.</strong> Each Kotlin release supports one Xcode line. From the\n<a href=\"https://kotlinlang.org/docs/multiplatform/multiplatform-compatibility-guide.html\">KMP compatibility guide</a>\non 3 Dec 2026: Kotlin 2.5.0 → Xcode 27.0; 2.4.0–2.4.21 → 26.4; 2.3.x → 26.0. Compare with\n<code>xcodebuild -version</code> and with the CI runner's Xcode. Tell the user about a mismatch; do not change\nXcode, <code>xcode-select</code> or runner images yourself. Done when the pairing is reported.</li>\n</ol>\n<p>Dependencies compiled with an older Kotlin are usually fine; dependencies compiled with a newer one\nare not. Upgrade the project's Kotlin first, then libraries that require it.</p>\n<h2>Workflow C — Share one catalog across repositories</h2>\n<p>Options, how to set each up, and how to override a version locally are in\n<a href=\"references/shared-catalogs-and-composite-builds.md\">references/shared-catalogs-and-composite-builds.md</a>.\nIn short: a git submodule imported with <code>from(files(...))</code>, or a catalog published with the\n<code>version-catalog</code> plugin and imported with <code>from(\"com.example:catalog:&lt;version&gt;\")</code>.</p>\n<p>Audit drift between catalogs, and hardcoded versions in build scripts, with the bundled script\n(paths relative to this skill's directory; read-only; output is a table or JSON):</p>\n<pre><code>python3 scripts/catalog_drift.py app=../notes-app/gradle/libs.versions.toml \\\n                                 sdk=../notes-sdk/gradle/libs.versions.toml --only-differs\npython3 scripts/catalog_drift.py gradle/libs.versions.toml --scan-gradle . --format json\npython3 scripts/catalog_drift.py --help\n</code></pre>\n<p>Exit code 1 with <code>--fail-on-drift</code> makes it usable in CI. Never downgrade to resolve drift without\nasking; align on the highest version that every consumer has been built against.</p>\n<h2>Workflow D — Convention plugins</h2>\n<p>When three or more modules repeat the same plugins, targets and SDK levels, move that block into a\n<code>build-logic</code> included build. Full setup — <code>build-logic/settings.gradle.kts</code> reading the same catalog,\n<code>compileOnly</code> plugin artifacts, and a <code>KmpLibraryConventionPlugin</code> that configures the\nAGP KMP library target — is in <a href=\"references/convention-plugins.md\">references/convention-plugins.md</a>.\nDo not create <code>build-logic</code> in a project that has none without asking; it is a structural change.</p>\n<h2>Workflow E — Develop a library locally against an app</h2>\n<p>Gate an <code>includeBuild</code> behind a Gradle property so the default build always uses the published\nartifact:</p>\n<pre><code>// settings.gradle.kts of the consuming app\nif (providers.gradleProperty(\"local.notes-sdk\").orNull == \"true\") {\n    includeBuild(\"../notes-sdk\") {\n        dependencySubstitution {\n            substitute(module(\"com.example:notes-sdk\")).using(project(\":sdk\"))\n        }\n    }\n}\n</code></pre>\n<pre><code>./gradlew :androidApp:assembleDebug -Plocal.notes-sdk=true\n</code></pre>\n<p>With the flag off, local library edits reach no consumer. Rebuild every consumer with its flag on\nbefore publishing a library change. Keep Kotlin and AGP identical across the composite. Never commit\nthe flag as <code>true</code>. Details and pitfalls are in the shared-catalogs reference.</p>\n<h2>Quick reference</h2>\n<table>\n<thead>\n<tr>\n<th>Task</th>\n<th>How</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Library accessor</td>\n<td><code>ktor-client-core</code> → <code>libs.ktor.client.core</code>; <code>[bundles] ktor-common</code> → <code>libs.bundles.ktor.common</code></td>\n</tr>\n<tr>\n<td>Plugin accessor</td>\n<td><code>libs.plugins.kotlinMultiplatform</code> in <code>plugins { alias(...) }</code></td>\n</tr>\n<tr>\n<td>Version in Kotlin code</td>\n<td><code>libs.versions.android.minSdk.get().toInt()</code></td>\n</tr>\n<tr>\n<td>Reserved alias words</td>\n<td><code>extensions</code>, <code>class</code>, <code>convention</code>; <code>bundles</code>, <code>versions</code>, <code>plugins</code> cannot start an alias</td>\n</tr>\n<tr>\n<td>Common-only dependency</td>\n<td><code>commonMain.dependencies { implementation(...) }</code></td>\n</tr>\n<tr>\n<td>Platform-only dependency</td>\n<td><code>androidMain</code> / <code>iosMain</code></td>\n</tr>\n<tr>\n<td>Test-only</td>\n<td><code>commonTest</code>; JVM-only test libraries (MockK, JUnit 5) go in <code>androidHostTest</code>, never <code>commonTest</code></td>\n</tr>\n<tr>\n<td>BOM (Android only)</td>\n<td><code>androidMain.dependencies { implementation(project.dependencies.platform(libs.firebase.bom)) }</code></td>\n</tr>\n<tr>\n<td>KSP</td>\n<td><code>add(\"ksp&lt;Target&gt;\", libs.x.compiler)</code> for each target</td>\n</tr>\n<tr>\n<td>Android-KMP library plugin</td>\n<td><code>{ id = \"com.android.kotlin.multiplatform.library\", version.ref = \"agp\" }</code></td>\n</tr>\n<tr>\n<td>Room 3</td>\n<td><code>androidx.room3:room3-runtime</code> / <code>room3-compiler</code>, plugin <code>androidx.room3</code></td>\n</tr>\n<tr>\n<td>Koin compiler plugin</td>\n<td><code>{ id = \"io.insert-koin.compiler.plugin\", version.ref = \"koin-plugin\" }</code></td>\n</tr>\n<tr>\n<td>Kotlin ↔ Xcode</td>\n<td>2.5.0 → 27.0; 2.4.x → 26.4 (re-check the compatibility guide)</td>\n</tr>\n<tr>\n<td>Latest version lookup</td>\n<td>klibs.io / KMP Libraries Expert; <code>android studio version-lookup</code></td>\n</tr>\n<tr>\n<td>Local library</td>\n<td><code>includeBuild</code> + <code>dependencySubstitution</code>, gated by <code>-Plocal.&lt;lib&gt;=true</code></td>\n</tr>\n</tbody>\n</table>\n<h2>Verify</h2>\n<p>Report every check as <code>PASS</code>, <code>FAIL</code> or <code>NOT RUN</code> (with the reason). Never report a check that did\nnot run as passed. Replace <code>:shared</code> with each module you touched.</p>\n<pre><code>./gradlew help                                         # catalog and settings parse\n./gradlew :shared:compileCommonMainKotlinMetadata\n./gradlew :shared:compileAndroidMain                   # legacy plugin: compileDebugKotlinAndroid\n./gradlew :shared:compileKotlinIosSimulatorArm64       # macOS only; proves the iOS variant resolves\n./gradlew :shared:allTests                             # or the project's test tasks\n./gradlew :androidApp:assembleDebug                    # or :composeApp:assembleDebug\n./gradlew :shared:dependencyInsight --dependency ktor-client-core --configuration &lt;configuration&gt;\npython3 scripts/catalog_drift.py gradle/libs.versions.toml --scan-gradle . --fail-on-drift\n</code></pre>\n<p>List configuration names for <code>dependencyInsight</code> with <code>./gradlew :shared:dependencies | grep -i classpath</code>.\nAfter a <code>kotlin</code> change also link the iOS framework (<code>linkDebugFrameworkIosSimulatorArm64</code>), build the\nXcode project, and report the Xcode version used (<code>xcodebuild -version</code>) next to the result.</p>\n<h2>Common mistakes</h2>\n<table>\n<thead>\n<tr>\n<th>Mistake</th>\n<th>Why it bites</th>\n<th>Fix</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Android-only library in <code>commonMain</code></td>\n<td>iOS compilation fails with \"No matching variant\" or unresolved artifacts</td>\n<td><code>androidMain</code> plus an interface in common</td>\n</tr>\n<tr>\n<td>Version literal in <code>build.gradle.kts</code></td>\n<td>Drifts from the catalog; invisible to upgrades</td>\n<td>Catalog entry with <code>version.ref</code></td>\n</tr>\n<tr>\n<td>Compose compiler or serialization plugin on its own version key</td>\n<td>Mismatched Kotlin compiler plugins fail the build after an upgrade</td>\n<td><code>version.ref = \"kotlin\"</code></td>\n</tr>\n<tr>\n<td>Koin compiler plugin on <code>version.ref = \"kotlin\"</code> or expected from <code>koin-bom</code></td>\n<td>It has its own release line; the version may not exist</td>\n<td>Separate <code>koin-plugin</code> key</td>\n</tr>\n<tr>\n<td>Using the Compose Multiplatform version for material3, navigation or lifecycle</td>\n<td>Those artifacts have separate version lines; the version may not exist or may not match</td>\n<td>Take each from the CMP release notes</td>\n</tr>\n<tr>\n<td>Bumping <code>kotlin</code> without checking Xcode locally and on CI</td>\n<td>Each Kotlin/Native release supports one Xcode line; the iOS side breaks while Android stays green</td>\n<td>Workflow B step 3; plan the set with <code>kmp-toolchain-upgrade</code></td>\n</tr>\n<tr>\n<td><code>androidx.room</code> and <code>androidx.room3</code> entries both in use</td>\n<td>Two Room generations, two compilers and plugins</td>\n<td>One generation; migrate with <code>kmp-room-database</code></td>\n</tr>\n<tr>\n<td>Adding <code>com.android.library</code> to a KMP module on AGP 9</td>\n<td>The KMP plugin no longer works with it there</td>\n<td><code>com.android.kotlin.multiplatform.library</code>; migrate with the AGP 9 skill</td>\n</tr>\n<tr>\n<td>JVM-only test library in <code>commonTest</code></td>\n<td>iOS test compilation fails</td>\n<td>Fakes in <code>commonTest</code>; JVM tools in <code>androidHostTest</code></td>\n</tr>\n<tr>\n<td>Plugin versions requested per module instead of once in the root</td>\n<td>\"The Kotlin Gradle plugin was loaded multiple times in different subprojects\", or \"already on the classpath with an unknown version\" when build-logic also provides it</td>\n<td><code>apply false</code> in root, versionless <code>alias</code> in modules</td>\n</tr>\n<tr>\n<td>A catalog named <code>libs</code> imported from a file while <code>gradle/libs.versions.toml</code> also exists</td>\n<td>Gradle auto-imports the default file; calling <code>from</code> twice fails</td>\n<td>One source: delete the stray file or rename one catalog</td>\n</tr>\n<tr>\n<td>KSP configured for some targets only</td>\n<td>That target fails to compile, or crashes at runtime where generated code is looked up dynamically</td>\n<td>One <code>ksp&lt;Target&gt;</code> line per target</td>\n</tr>\n<tr>\n<td><code>includeBuild</code> always on</td>\n<td>CI and teammates build unpublished code; releases differ from what was tested</td>\n<td>Gate it with a property that defaults to off</td>\n</tr>\n<tr>\n<td>Upgrading Kotlin, AGP and CMP in one commit</td>\n<td>A failure cannot be attributed</td>\n<td>One axis per commit</td>\n</tr>\n<tr>\n<td>Accessing <code>libs.plugins.*</code> inside a precompiled script plugin's <code>plugins {}</code></td>\n<td>Not supported by Gradle</td>\n<td>Binary convention plugins with <code>VersionCatalogsExtension</code></td>\n</tr>\n</tbody>\n</table>\n<h2>Related skills</h2>\n<ul>\n<li><code>kmp-toolchain-upgrade</code> — Kotlin, Compose Multiplatform, AGP, Gradle, JDK and Xcode compatibility\nand the order to upgrade them.</li>\n<li><code>kmp-feature-module</code> — new modules and their build files.</li>\n<li><code>kmp-room-database</code>, <code>kmp-koin-di</code> — Room 3 and Koin setup beyond the catalog entries.</li>\n<li><code>kmp-module-health</code> — audits hardcoded versions and build config per module.</li>\n<li><code>kmp-build-failure-triage</code> in this repo — diagnosing a red build.</li>\n<li><a href=\"https://github.com/Kotlin/kotlin-agent-skills\">Kotlin/kotlin-agent-skills</a> — AGP 9 migration,\nKotlin/Native build performance.</li>\n<li><a href=\"https://github.com/JetBrains/klibs-io/tree/release/skills/kmp-libraries-expert\">Kotlin Multiplatform Libraries Expert</a>\n(JetBrains, klibs.io) — KMP library discovery, target support, latest coordinates.</li>\n<li><a href=\"https://github.com/android/skills/tree/main/devtools/android-cli\">Google <code>android-cli</code></a> —\n<code>android studio version-lookup</code> and other Android CLI commands.</li>\n<li><a href=\"https://github.com/chrisbanes/skills/tree/main/skills/gradle-run\">chrisbanes/skills <code>gradle-run</code></a> —\nrunning Gradle with compact output.</li>\n<li><a href=\"https://docs.gradle.org/current/userguide/version_catalogs.html\">Gradle version catalogs</a>,\n<a href=\"https://docs.gradle.org/current/userguide/composite_builds.html\">composite builds</a>,\n<a href=\"https://kotlinlang.org/docs/multiplatform/multiplatform-add-dependencies.html\">KMP dependencies</a>.</li>\n</ul>\n","files":[{"path":"references/catalog-syntax.md","sizeBytes":4054,"isText":true},{"path":"references/convention-plugins.md","sizeBytes":7441,"isText":true},{"path":"references/shared-catalogs-and-composite-builds.md","sizeBytes":6177,"isText":true},{"path":"scripts/catalog_drift.py","sizeBytes":10215,"isText":true},{"path":"scripts/tests/test_catalog_drift.py","sizeBytes":8074,"isText":true},{"path":"SKILL.md","sizeBytes":22894,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-12-03T17:30:13.800555Z","sha256":"0E720C1DF374E8E39FC6FFDBAD68DEB3D3BC75EFBE077079CEF666EFB2B5D45A","sizeBytes":21458},"review":null,"source":{"repositoryUrl":"https://github.com/Kushpawan/kmp-mobile-skills","path":"skills/kmp-gradle-version-catalog","license":"Apache-2.0","commit":"c04c11f696aa7a0f3c67761e5e48a7fd8201efa9","subtreeSha":"3B9816FFC79569AEFAB770AFE24649AC729A1039EFE462B0E0474C21C6F08970","lastSyncedAt":"2026-12-03T17:29:47.313948Z"},"reviewedAt":"2026-12-03T17:31:34.843237Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/Kushpawan/kmp-mobile-skills/tree/main/skills/kmp-gradle-version-catalog"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kushpawan-kmp-mobile-skills@llmmart"},{"target":"git","command":"git clone https://github.com/Kushpawan/kmp-mobile-skills.git"}]}