How to Set Up Kotlin Multiplatform: Complete Development Guide 2025
Learn how to set up Kotlin Multiplatform for cross-platform mobile development. Complete step-by-step guide covering environment setup, Firebase integration, and production-ready configuration in 2025.
Posted by
Related reading
Kotlin Multiplatform Testing in 2025: Complete Guide to Unit, Integration & UI Tests
Master KMP testing with this complete guide. Learn to write shared tests once, run everywhere. Includes Kotest, Turbine, and MockK examples with real production patterns.
Kotlin to Swift Export: Native iOS Integration Guide 2025
Kotlin 2.2.20's Swift Export delivers native Swift interop for KMP. Code examples, migration guide, and production readiness assessment for iOS teams.
How to Build a Production-Ready Mobile App with Kotlin Multiplatform (in Days)
Looking to launch Android and iOS apps fast? Learn how to build a production-ready mobile app using Kotlin Multiplatform: with auth, payments, CI/CD, and more, all from a single codebase.

Introduction: Why Kotlin Multiplatform is the Smart Choice in 2025
What You'll Accomplish
- ✅ A fully configured Kotlin Multiplatform development environment
- ✅ A working cross-platform project for Android and iOS
- ✅ Firebase integration for authentication and analytics
- ✅ Understanding of project structure and best practices
- ✅ Knowledge of common pitfalls and how to avoid them
Prerequisites & Environment Setup
System Requirements
- Windows 10+, macOS 10.14+, or Linux (Ubuntu 16.04+)
- 8GB RAM minimum (16GB recommended)
- 50GB free disk space
- Android Studio Hedgehog (2023.1.1) or later
- macOS 12.0 (Monterey) or later
- Xcode 14.0 or later
- iOS Simulator or physical iOS device
- Apple Developer account (for device testing and App Store deployment)
Environment Verification with KDoctor
bashbrew install kdoctor
bashkdoctor
- ✅ Java Development Kit (JDK) version and configuration
- ✅ Android SDK and required components
- ✅ Xcode installation and command line tools (macOS only)
- ✅ CocoaPods configuration (macOS only)
- ✅ Kotlin Multiplatform plugin availability
Development Tools Setup
- Install Android Studio from the official website
- Install the Kotlin Multiplatform Mobile plugin
- Configure Android SDK (API level 24+ recommended)
- Set up Android emulator devices
- Install Xcode from the Mac App Store
- Install Xcode command line tools:
xcode-select --install - Install CocoaPods:
sudo gem install cocoapods - Set up iOS Simulator devices
Setting Up with KMPShip
Step 1: Clone the KMPShip Repository
bashgit clone git@github.com:TweenerLabs/kmp-ship.git [YOUR_APP_NAME] cd [YOUR_APP_NAME]
[YOUR_APP_NAME] with your actual project name (e.g., my-awesome-app).Step 2: Project Renaming and Configuration
bash./gradlew renameProject -PprojectName=MyApp -PpackageName=com.example.myapp
projectName: Your app's display name (e.g., "MyApp", "TaskManager")packageName: Your app's unique package identifier (e.g., "com.yourcompany.appname")
- Use reverse domain notation (com.company.app)
- Keep it lowercase with no special characters
- Make it unique to avoid conflicts
- Consider your company/personal domain
bashgit add . git commit -m "Initial KMPShip setup before renaming"
Step 3: Git Configuration (Pro Plan Optional)
bash# Rename the default remote to upstream git remote rename origin upstream # Add your personal repository as the new origin git remote add origin git@github.com:yourusername/your-app.git # Push to your repository git push -u origin main
Firebase Integration Setup
Step 1: Create Firebase Project
- Visit Firebase Console: Navigate to https://console.firebase.google.com
- Sign In: Use your Google account
- Create Project:
- Click "Add project"
- Enter your project name
- Enable Google Analytics (recommended for user behavior insights)
- Select or create Analytics account
- Accept terms and create project
Step 2: Android App Configuration
-
Add Android App:
- In Firebase Console, click "Add app"
- Select the Android icon
- Enter your package name (same as used in
renameProject) - Optionally add app nickname and SHA-1 certificate
-
Download Configuration File:
- Download the
google-services.jsonfile - Place it in:
androidApp/google-services.json
- Download the
google-services.json file must be in the exact location shown above for Android builds to work correctly.Step 3: iOS App Configuration
-
Add iOS App:
- In Firebase Console, click "Add app"
- Select the iOS icon
- Enter your bundle ID (same package name as Android)
- Optionally add app nickname and App Store ID
-
Download Configuration File:
- Download the
GoogleService-Info.plistfile - Place it in:
iosApp/iosApp/Firebase/GoogleService-Info.plist
- Download the
Step 4: Sync and Verify
- Sync Project: In Android Studio, click "Sync Now" when prompted
- Clean Build: Run
./gradlew cleanto ensure clean configuration - Verify Integration: The Firebase SDK will automatically initialize when you run your app
Project Structure & First Build
Project Structure Overview
your-app/
├── shared/ # Shared Kotlin code
│ ├── src/
│ │ ├── commonMain/ # Common logic (business logic, data models)
│ │ ├── androidMain/ # Android-specific implementations
│ │ └── iosMain/ # iOS-specific implementations
│ └── build.gradle.kts
├── androidApp/ # Android application
│ ├── src/main/
│ ├── google-services.json
│ └── build.gradle.kts
├── iosApp/ # iOS application
│ ├── iosApp/
│ │ └── Firebase/
│ │ └── GoogleService-Info.plist
│ └── iosApp.xcodeproj
└── build.gradle.kts
Key Directories Explained
shared/commonMain/: Contains business logic, data models, networking code, and utility functions that work across all platforms.shared/androidMain/ & shared/iosMain/: Platform-specific implementations of shared interfaces (e.g., database access, platform APIs).androidApp/: Standard Android app module with Activities, Fragments, and Android-specific UI code.iosApp/: Xcode project containing iOS-specific UI code, ViewControllers, and iOS app configuration.Running Your First Build
- Open Android Studio
- Select "Open" and choose your project directory
- Wait for Gradle sync to complete
- Select
androidApprun configuration - Choose an emulator or connected device
- Click "Run" (green triangle button)
- In Android Studio, select
iosApprun configuration - Choose iOS Simulator device
- Click "Run" - this opens Xcode automatically
- Alternatively, open
iosApp/iosApp.xcworkspacein Xcode directly - Select a simulator and click "Run"
- ✅ Both Android and iOS apps launch successfully
- ✅ No build errors in console
- ✅ Firebase integration initializes (check logs)
- ✅ Basic app functionality works on both platforms
Troubleshooting Common Issues
KDoctor Diagnostic Failures
- Java Issues: Ensure JDK 11 or later is installed and
JAVA_HOMEis set correctly - Android SDK: Update Android SDK through Android Studio SDK Manager
- Xcode Issues: Run
xcode-select --installand accept license agreements - CocoaPods Problems: Update with
sudo gem install cocoapods --pre
Firebase Configuration Errors
- Verify file placement exactly as specified above
- Ensure bundle ID/package name matches between app and Firebase
- Clean and rebuild project after adding configuration files
- Check that files are included in Git (not ignored)
Build Issues and Solutions
bash# Clear Gradle cache ./gradlew clean # Invalidate Android Studio caches # File → Invalidate Caches and Restart # Update Gradle wrapper ./gradlew wrapper --gradle-version=8.4
bash# Clean iOS build cd iosApp xcodebuild clean -workspace iosApp.xcworkspace -scheme iosApp # Update CocoaPods cd .. ./gradlew podInstall
Platform-Specific Problems
- Reset simulator: Device → Erase All Content and Settings
- Update Xcode and iOS Simulator versions
- Check available disk space (iOS builds require significant space)
- Enable hardware acceleration in BIOS/UEFI settings
- Increase emulator RAM allocation
- Use x86_64 system images for better performance
Memory and Performance Issues
bash# Add to gradle.properties org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.caching=true
Next Steps & Advanced Configuration
Authentication Configuration
- Google Sign-In: OAuth integration for both platforms
- Apple Sign-In: Required for iOS App Store compliance
- Email/Password: Traditional authentication method
- Anonymous Authentication: For guest users
CI/CD Pipeline Setup
- Automated Testing: Unit tests and integration tests on every PR
- Android Builds: Automatic APK/AAB generation and Play Store deployment
- iOS Builds: Automatic IPA generation and App Store Connect deployment
- Code Quality: Linting, formatting, and security checks
Performance Optimization
- Enable Gradle build cache and parallel execution
- Use
--configuration-cachefor faster subsequent builds - Configure proper heap sizes for large projects
- Kotlin Multiplatform compiles to native code for optimal performance
- Shared code has minimal overhead compared to native implementations
- Use platform-specific optimizations when needed
Production Deployment Preparation
- Configure release signing keys
- Enable ProGuard/R8 for code optimization
- Set up Play Store metadata and assets
- Configure provisioning profiles and certificates
- Set up App Store Connect metadata
- Prepare App Store screenshots and descriptions
Manual Setup vs KMPShip: Making the Right Choice
Manual Setup: When to Choose
- Learning Kotlin Multiplatform fundamentals
- Highly customized project requirements
- Academic or experimental projects
- Teams with extensive KMP experience
KMPShip: When to Choose
- Production apps with tight deadlines
- Teams new to Kotlin Multiplatform
- Apps requiring authentication, payments, and CI/CD
- Indie developers and small teams
Feature Comparison
| Feature | Manual Setup | KMPShip |
|---|---|---|
| Basic Project Structure | ✅ 4-6 hours | ✅ 5 minutes |
| Firebase Authentication | ❌ 8-12 hours | ✅ Pre-configured |
| In-App Purchases | ❌ 15-20 hours | ✅ RevenueCat integrated |
| Push Notifications | ❌ 6-8 hours | ✅ Cross-platform ready |
| CI/CD Pipeline | ❌ 10-15 hours | ✅ GitHub Actions included |
| Production Deployment | ❌ 5-10 hours | ✅ Automated workflows |
| Total Setup Time | 48-71 hours | 30 minutes |
Cost Analysis
- 50-70 hours × $150/hour = $7,500-$10,500
- Ongoing maintenance and updates
- Risk of implementation bugs and security issues
- €79 one-time cost
- Includes lifetime updates and community support
- Production-tested implementations
Conclusion: Your Kotlin Multiplatform Journey Starts Here
Quick Setup Questions
- Do I need a Mac for iOS development? - Platform requirements explained
- How long does setup actually take? - Real timeline expectations
- What's the total cost comparison? - Manual vs KMPShip cost breakdown
- What support is available? - Development help and community access
Continue Your KMP Learning
- KMP vs Flutter vs React Native comparison - Choose the right framework
- Mobile app monetization with KMP - Revenue strategies and implementation
- Production-ready KMP development - Advanced implementation patterns