Back to Blog

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

How to Set Up Kotlin Multiplatform Complete Guide 2025

Introduction: Why Kotlin Multiplatform is the Smart Choice in 2025

Kotlin Multiplatform (KMP) has evolved from an experimental technology to a production-ready solution that's revolutionizing cross-platform mobile development. With Google's full backing, JetBrains' continued investment, and major companies like Netflix, McDonald's, and Cash App successfully using it in production, 2025 is the perfect time to adopt KMP for your mobile projects.
Unlike other cross-platform frameworks that compromise on performance or native feel, Kotlin Multiplatform lets you share business logic while keeping native UIs, giving you the best of both worlds: development efficiency and native performance.
In this comprehensive guide, you'll learn how to set up a complete Kotlin Multiplatform development environment and build your first cross-platform app. Whether you choose the manual setup approach or the accelerated KMPShip route, you'll have a production-ready foundation by the end of this tutorial.

What You'll Accomplish

By following this guide, you'll have:
  • ✅ 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
Time Investment: 30 minutes with KMPShip vs 4-6 hours manually

Prerequisites & Environment Setup

Before diving into Kotlin Multiplatform development, you need to ensure your development environment is properly configured. This is crucial because KMP requires specific tools and configurations to work across both Android and iOS platforms.

System Requirements

For Android Development (Any Platform):
  • 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
For iOS Development (macOS Required):
  • 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)
Important: You need a Mac for iOS development, but you can develop the shared Kotlin logic on any platform and use CI/CD for iOS builds.

Environment Verification with KDoctor

KDoctor is an essential tool that verifies your development environment is correctly configured for Kotlin Multiplatform development. It checks all necessary dependencies and provides clear guidance on fixing any issues.
Install KDoctor:
bash
brew install kdoctor
Run Environment Check:
bash
kdoctor
KDoctor will verify:
  • ✅ 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
Fix Any Issues: KDoctor provides specific instructions for resolving each detected problem. Don't proceed until all checks pass green.

Development Tools Setup

Android Studio Configuration:
  1. Install Android Studio from the official website
  2. Install the Kotlin Multiplatform Mobile plugin
  3. Configure Android SDK (API level 24+ recommended)
  4. Set up Android emulator devices
Xcode Setup (macOS only):
  1. Install Xcode from the Mac App Store
  2. Install Xcode command line tools: xcode-select --install
  3. Install CocoaPods: sudo gem install cocoapods
  4. Set up iOS Simulator devices

Setting Up with KMPShip

KMPShip provides a production-ready Kotlin Multiplatform boilerplate that includes authentication, payments, notifications, CI/CD, and everything configured out of the box. This approach saves weeks of manual configuration and gets you to market faster.

Step 1: Clone the KMPShip Repository

After purchasing KMPShip, you'll receive access to the private GitHub repository. Clone it to your local machine:
bash
git clone git@github.com:TweenerLabs/kmp-ship.git [YOUR_APP_NAME] cd [YOUR_APP_NAME]
Replace [YOUR_APP_NAME] with your actual project name (e.g., my-awesome-app).

Step 2: Project Renaming and Configuration

KMPShip includes a powerful Gradle task that renames your project and updates all package references automatically:
bash
./gradlew renameProject -PprojectName=MyApp -PpackageName=com.example.myapp
Important Parameters:
  • projectName: Your app's display name (e.g., "MyApp", "TaskManager")
  • packageName: Your app's unique package identifier (e.g., "com.yourcompany.appname")
Best Practices for Package Naming:
  • 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
Commit Before Renaming:
bash
git add . git commit -m "Initial KMPShip setup before renaming"

Step 3: Git Configuration (Pro Plan Optional)

If you have the Pro plan, you can maintain connection to KMPShip updates while using your own repository:
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
This setup allows you to pull KMPShip updates when needed while maintaining your own development workflow.

Firebase Integration Setup

Firebase provides essential services for modern mobile apps including authentication, analytics, remote configuration, and crash reporting. KMPShip is designed to work seamlessly with Firebase, making this integration crucial for production apps.

Step 1: Create Firebase Project

  1. Visit Firebase Console: Navigate to https://console.firebase.google.com
  2. Sign In: Use your Google account
  3. 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

  1. 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
  2. Download Configuration File:
    • Download the google-services.json file
    • Place it in: androidApp/google-services.json
File Placement is Critical: The google-services.json file must be in the exact location shown above for Android builds to work correctly.

Step 3: iOS App Configuration

  1. 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
  2. Download Configuration File:
    • Download the GoogleService-Info.plist file
    • Place it in: iosApp/iosApp/Firebase/GoogleService-Info.plist
Bundle ID Consistency: Ensure your iOS bundle ID exactly matches your Android package name for consistent Firebase project configuration.

Step 4: Sync and Verify

After placing both configuration files:
  1. Sync Project: In Android Studio, click "Sync Now" when prompted
  2. Clean Build: Run ./gradlew clean to ensure clean configuration
  3. Verify Integration: The Firebase SDK will automatically initialize when you run your app

Project Structure & First Build

Understanding the Kotlin Multiplatform project structure is essential for effective development. KMPShip organizes code in a clean, scalable architecture that follows industry best practices.

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

Android Build:
  1. Open Android Studio
  2. Select "Open" and choose your project directory
  3. Wait for Gradle sync to complete
  4. Select androidApp run configuration
  5. Choose an emulator or connected device
  6. Click "Run" (green triangle button)
iOS Build:
  1. In Android Studio, select iosApp run configuration
  2. Choose iOS Simulator device
  3. Click "Run" - this opens Xcode automatically
  4. Alternatively, open iosApp/iosApp.xcworkspace in Xcode directly
  5. Select a simulator and click "Run"
Verification Steps:
  • ✅ 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

Even with proper setup, developers often encounter specific issues when setting up Kotlin Multiplatform projects. Here are the most common problems and their solutions:

KDoctor Diagnostic Failures

Issue: KDoctor reports missing or incorrectly configured tools.
Solutions:
  • Java Issues: Ensure JDK 11 or later is installed and JAVA_HOME is set correctly
  • Android SDK: Update Android SDK through Android Studio SDK Manager
  • Xcode Issues: Run xcode-select --install and accept license agreements
  • CocoaPods Problems: Update with sudo gem install cocoapods --pre

Firebase Configuration Errors

Issue: "GoogleService-Info.plist not found" or "google-services.json missing"
Solutions:
  • 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

Android Build Failures:
bash
# Clear Gradle cache ./gradlew clean # Invalidate Android Studio caches # File → Invalidate Caches and Restart # Update Gradle wrapper ./gradlew wrapper --gradle-version=8.4
iOS Build Failures:
bash
# Clean iOS build cd iosApp xcodebuild clean -workspace iosApp.xcworkspace -scheme iosApp # Update CocoaPods cd .. ./gradlew podInstall

Platform-Specific Problems

iOS Simulator Issues:
  • Reset simulator: Device → Erase All Content and Settings
  • Update Xcode and iOS Simulator versions
  • Check available disk space (iOS builds require significant space)
Android Emulator Issues:
  • Enable hardware acceleration in BIOS/UEFI settings
  • Increase emulator RAM allocation
  • Use x86_64 system images for better performance

Memory and Performance Issues

If builds are slow or fail due to memory:
bash
# Add to gradle.properties org.gradle.jvmargs=-Xmx4096m org.gradle.parallel=true org.gradle.caching=true

Next Steps & Advanced Configuration

Once you have a working Kotlin Multiplatform setup, you can enhance your project with advanced features and production-ready configurations.

Authentication Configuration

KMPShip includes pre-configured authentication using Firebase Auth with support for:
  • 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
Configuration is handled automatically through the Firebase setup you completed earlier.

CI/CD Pipeline Setup

KMPShip includes GitHub Actions workflows for:
  • 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

Build Performance:
  • Enable Gradle build cache and parallel execution
  • Use --configuration-cache for faster subsequent builds
  • Configure proper heap sizes for large projects
Runtime Performance:
  • 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

Android Preparation:
  • Configure release signing keys
  • Enable ProGuard/R8 for code optimization
  • Set up Play Store metadata and assets
iOS Preparation:
  • 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

Understanding when to choose manual setup versus KMPShip helps you make the best decision for your project timeline and requirements.

Manual Setup: When to Choose

Best For:
  • Learning Kotlin Multiplatform fundamentals
  • Highly customized project requirements
  • Academic or experimental projects
  • Teams with extensive KMP experience
Time Investment: 20-40 hours for production-ready setup Complexity: High - requires deep KMP knowledge

KMPShip: When to Choose

Best For:
  • Production apps with tight deadlines
  • Teams new to Kotlin Multiplatform
  • Apps requiring authentication, payments, and CI/CD
  • Indie developers and small teams
Time Investment: 30 minutes to working app Complexity: Low - pre-configured and battle-tested

Feature Comparison

FeatureManual SetupKMPShip
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 Time48-71 hours30 minutes

Cost Analysis

Manual Development:
  • 50-70 hours × $150/hour = $7,500-$10,500
  • Ongoing maintenance and updates
  • Risk of implementation bugs and security issues
KMPShip Investment:
  • €79 one-time cost
  • Includes lifetime updates and community support
  • Production-tested implementations
The choice is clear: KMPShip provides exceptional value for teams focused on shipping products rather than building infrastructure.


Conclusion: Your Kotlin Multiplatform Journey Starts Here

Setting up Kotlin Multiplatform for production-ready development doesn't have to be overwhelming. Whether you choose the comprehensive KMPShip approach or prefer manual configuration, you now have the knowledge to build cross-platform apps that deliver native performance with shared business logic.
The mobile app development landscape in 2025 rewards speed to market and user experience quality. Kotlin Multiplatform provides the technical foundation for both, while solutions like KMPShip eliminate the setup complexity that traditionally slows down development teams.
Ready to build your cross-platform app? The foundation is set, the tools are ready, and the community is thriving. Your next step is to start building the features that make your app unique while KMP handles the cross-platform complexity.


Quick Setup Questions

Need specific guidance for your Kotlin Multiplatform setup? Get instant answers:

Continue Your KMP Learning

Expand your Kotlin Multiplatform knowledge with these related guides:

Start Building Today

Skip weeks of configuration and start building features that matter. While your competitors debug setup issues, you could be implementing the core functionality that drives user engagement and revenue.

The mobile app market rewards execution speed over setup complexity. Choose the smart path and focus your expertise where it creates competitive advantage.