kotlin-tooling-cocoapods-spm-migration

Migrate Kotlin Multiplatform projects from CocoaPods to Swift Package Manager dependencies.

Updated Apr 1, 2026
One-click install
npx skills add https://github.com/DCueto/zen-track --skill kotlin-tooling-cocoapods-spm-migration-dcueto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kotlin-tooling-cocoapods-spm-migration
Source: https://github.com/DCueto/zen-track/tree/main/ZenTrackApp/.agents/skills/kotlin-tooling-cocoapods-spm-migration
Command: npx skills add https://github.com/DCueto/zen-track --skill kotlin-tooling-cocoapods-spm-migration-dcueto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Kotlin Multiplatform projects using the deprecated kotlin("native.cocoapods") plugin need a structured, safe path to adopt the new swiftPMDependencies DSL without breaking Gradle builds, Xcode integration, or Kotlin cinterop imports. ## Core Features & Use Cases - Phased Migration Workflow: Eight guided phases covering pre-migration analysis, Gradle reconfiguration, swiftPMDependencies setup, import transformation, Xcode reconfiguration, CocoaPods removal, verification, and reporting. - Pod-to-SPM Mapping: Reference tables map popular pods (Firebase suite, Google Maps, Google Sign-In) to SPM package URLs, product names, version semantics, and importedClangModules. - Edge-Case Handling: Preserves cocoapods.* imports backed by third-party bundled cinterop klibs (e.g., KMPNotifier), handles dev.gitlive Firebase wrappers, Crashlytics dSYM scripts, and sandboxing fixes. - Use Case: A team with a KMP shared module using Firebase pods runs this migration to replace pod() declarations with swiftPackage(), transform imports to swiftPMImport.*, deintegrate CocoaPods from the Xcode project, and produce a MIGRATION_REPORT.md. ## Quick Start Migrate my Kotlin Multiplatform shared module from CocoaPods to Swift Package Manager and verify the iOS app still builds.

Frequently Asked Questions about kotlin-tooling-cocoapods-spm-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a Kotlin Multiplatform project from CocoaPods to SwiftPM?▼

Add a swiftPMDependencies block alongside the existing cocoapods block, map each pod() to a swiftPackage() declaration, transform cocoapods.* imports to swiftPMImport.<group>.<module>.*, run the integrateEmbedAndSign and integrateLinkagePackage tasks, then remove the CocoaPods plugin and verify the build.

How do I map Firebase CocoaPods to Swift Package Manager in KMP?▼

All Firebase products come from the firebase-ios-sdk repository. Declare them as products in one swiftPackage entry, set discoverModulesImplicitly = false, and list Clang modules explicitly — some differ from product names, e.g. FirebaseFirestoreInternal for FirebaseFirestore.

Why do some cocoapods.* imports fail after converting to swiftPMImport?▼

Third-party KMP libraries like KMPNotifier bundle their own cinterop klibs using the cocoapods.* namespace. The SwiftPM cinterop generator skips those modules, so those imports must stay as cocoapods.* — replacing them causes unresolved reference errors.

Does swiftPMDependencies work with dev.gitlive firebase-kotlin-sdk?▼

Yes, but it requires isStatic = true on the framework to avoid dyld runtime crashes, plus per-product -F linkerOpts in Gradle and matching FRAMEWORK_SEARCH_PATHS in Xcode, because the published klibs contain CocoaPods-era -framework linker flags.

Why does the Xcode build fail with checkSandboxAndWriteProtection after migration?▼

Xcode 16+ enables User Script Sandboxing by default, blocking the Gradle build phase from writing to the project directory. Set ENABLE_USER_SCRIPT_SANDBOXING = NO in the project.pbxproj and restart the Gradle daemon with ./gradlew --stop.

What are the requirements for using the swiftPMDependencies DSL?▼

You need a Kotlin version with Swift Import support (e.g., 2.4.0-Beta1 or later), Xcode 16.4 or 26.0+, and an iOS deployment target of 16.0 or higher recommended. Dev Kotlin builds may also require the JetBrains Maven repository.