KaMP Kit by Touchlab is a collection of code and tools designed to get your mobile team started quickly with Kotlin Multiplatform.


KaMPKit Shared KaMPKit Android KaMPKit iOS

KaMP Kit

KaMP Kit Image

Welcome to the KaMP Kit!



The goal of the KaMP Kit is to facilitate your evaluation of Kotlin Multiplatform (aka KMP). It is a collection of code and tools designed to get you started quickly.

The KMP ecosystem has generated a lot of excitement, and has evolved very rapidly. As a result, there's a lot of old or conflicting documentation, blog posts, tutorials, etc. We, Touchlab, have worked with several teams looking at KMM and KMP, and have found that the primary stumbling block is simply getting started.

The KaMP Kit is designed to get you past that primary stumbling block. You should be able to set up your development environment, clone the repo, and have a running sample app very quickly. From there, you can focus on what you want to build.

Very Important Message!!!

This kit exists because the info you may find from Google about KMM and KMP is likely to be outdated or conflicting with the config here. It is highly recommended that you reach out directly if you run into issues.


We (Touchlab) are focused primarily on using KMP for native mobile development (now called KMM). As a result, this kit is primarily targeted at native mobile developers (Android or iOS), as well as engineering managers for native mobile teams. You should have little-to-no experience with KMP, although some of the information after setup may be useful if you do have KMP experience.

What's Included?

  1. The Starter App - A native mobile KMP app with a small functional feature set.
  2. Educational Resources - Introductory information on KMP and Kotlin/Native.
  3. Integration Information - If you're integrating shared code into an existing application, guides to assist with that effort.

What's Not Included?

Comprehensive guides, advanced tutorials, or generally support for fixing anything not included in the starter app. The goal is to have a solid starting point from which you can create something meaningful for evaluating KMP. We're intentionally limiting the scope to keep focus.

Getting Help

KaMP Kit support can be found in the Kotlin Community slack. Look for the kampkit-support channel.

To join the Kotlin Community slack, request access here

For direct assistance, please reach out to Touchlab to discuss support options.

The Starter App

The central part of the "Kit" is the starter app. It includes a set of libraries that we use in our apps that provide for much of the architectural needs of a native mobile application. We've also included a simple set of features you can use as a reference when adding your features.

1) Dev Environment and Build Setup

You will need the following:

  • JVM 8
  • Android SDK and the latest stable Android Studio(4.1.3) or IntelliJ(2021.1+)
  • Intellij Kotlin plugin with 1.4.3x support (should be included in the latest Android Studio or IDEA)
  • Mac with Xcode 12+ for the iOS build

For a more detailed guide targetted at iOS developers, see DETAILED_DEV_SETUP.

2) Clone and Build

See APP_BUILD for detailed build instructions. By the end of that doc you should be able to build and run both Android and iOS apps.

Sanity Check

At this point, you should be able to build Android and iOS apps. If you cannot build, you need to get help. This sample app is configured to run out of the box, so if it's not working, you have something wrong with your build setup or config. Please reach out to us so we can improve either the config or troubleshooting docs, and/or the Kotlin Slack group mentioned above.

3) Walk Through App

Take a walk through the app's code and libraries. Make changes, recompile. See how it works.


4) Background Education

If the app is building, it's a good time to take a break and get some background information.

KMP Intro

It's important to understand not just how to set up the platform, but to get a better perspective on what the tech can do and why we think it'll be very successful. KMP is distinct from other code sharing and "cross platform" systems, and understanding those distinctions is useful.

Longer intro to KaMP Kit - Original version of this doc's intro. Cut because it was pretty long.

Intro to Kotlin Multiplatform - General intro to KMP from Oredev in Nov 2019. Good overall summary of the platform.

Kotlin/Native Concurrency

Kotlin/Native's state and concurrency model is different than the JVM (which includes Android). The goal is "Saner Concurrency" In practice, if you're not writing custom concurrency logic, it's pretty simple, but only if you understand it. You must learn the basics.

Practical Kotlin Native Concurrency - Our recent blog post series. This was written for KaMP KIt, but we published these separately because this is very important for developers to understand.

Kotlinconf 2019: Kotlin Native Concurrency Explained - Deeper dive talk from Kotlinconf.

We cannot stress this enough. If you're going to build anything significant, you need at least a basic understanding of the concurrency model.

We should also point out, the version of coroutines we're using in native is still a preview release. We discuss that in the docs linked above, and more detail in GENERAL_ARCHITECTURE.

"Selling" KMP

KaMPKit can help you demonstrate to management and other stakeholders of the value of sharing code with KMP. Check out these resources for more advice on pitching KMP to your team: Building a Business Case for KMP 7 ways to convince your engineering manager to pilot Kotlin Multiplatform

Xcode Debugging

For information on how to debug kotlin in Xcode, check out the Debugging Kotlin In Xcode doc.

5) Integrating 'shared' With Existing Apps

As part of your evaluation, you'll need to decide if you're going to integrate KMP into existing apps. Some teams feel integrating with their production apps is a better demonstration of KMP's viability. While KMP's interop is great, relative to other technologies, integrating anything into a production app build process can be a difficult task. Once integrated, development is generally smooth, but modifying production build systems can be a time consuming task.


The Android side is somewhat more straightforward. Kotlin is the preffered language for Android, and the library can be integrated as just another module library. We'll be updating soon with a general Android integration doc. In the meantime, the simplest method would be to copy the shared module into your standard Android build, and use the app module as a reference for dependency resolution.


The iOS integration process is relatively new and has been iterating fast. Be prepared to spend more time with config related issues when integrating with a production build.

You can integrate with Cocoapods, or by directly including the Xcode framework. If you are an Android developer without extensive iOS build experience, be aware that this is a risky option. Production build systems, for any ecosystem, tend to be complex. You'll almost certainly need to recruit somebody with experience maintaining your iOS build.

See IOS_PROJ_INTEGRATION.md for iOS integration information.

If you are attempting to integrate your KMP project with a production iOS application, please let us know what issues you run into and reach out with questions if stuck. This is an ongoing area of improvement for the KMP platform and we'd like to help make this as smooth as possible.


TROUBLESHOOTING - We'll be growing this file over time, with your help. Please make sure to document any issues you run into and let us know.

More To Come!

KaMP Kit is just the beginning. Our hope is that after KaMP Kit you’ll have a better sense of what a possible KMP implementation might look like.

Primary Maintainer

Brady Aiello

Ping me on twitter @AielloBrady if you don't get a timely reply! -Brady

About Touchlab

Touchlab is a mobile-focused development agency based in NYC. We have been working on Android since the beginning, and have worked on a wide range of mobile and hardware projects for the past decade. Over the past few years, we have invested significantly on R&D for code sharing technologies. We believe strongly in KMP's future and are making the Kotlin platform the focus of our business.

About The Kit

We talked to a few teams early on who got to do a "hack week" with KMP. A common story was, if they didn't abandon the project altogether, they didn't have anything running till the week was half over. Even then, picking libraries and architecture ate the rest of the time. Inevitably the result was, "KMP isn't ready". We know that once you're past the setup phase, KMP is really amazing tech. This Kit exists so you're evaluating KMP on Monday afternoon, not Thursday.

What We Can Do For You

We have made KMP the focus of Touchlab. We had possibly the first KMP* app published in the iOS App Store, and have extensive experience in building libraries and the Kotlin platform, including contributions to Kotlin/Native itself. We can establish and accelerate your adoption of shared Kotlin code. See touchlab.co for more info.

We're Hiring!

Touchlab is looking for a Mobile Developer, with Android/Kotlin experience, who is eager to dive into Kotlin Multiplatform Mobile (KMM) development. Come join the remote-first team putting KMM in production. More info here.


  • Removed jcenter references

    Removed jcenter references

    Issue: None associated


    • [x] iOS
    • [x] Android
    • [x] KMP


    JCenter is shutting down, which means that active projects should not rely on it. All of KaMPKit's dependencies are now available through other artifact repositories which means it's safe to remove JCenter from this project.


    Removed references to JCenter.


    Checked if syncing Gradle fails.

    opened by shalbert94 8
  • Issue-194: Remove Bintray dependencies and update to latest Koin release

    Issue-194: Remove Bintray dependencies and update to latest Koin release

    Closes #194


    • [x] iOS
    • [x] Android
    • [x] KMP


    We were still reading Koin from Bintray (oops!)


    Update to release version of Koin which is published to Maven Central, and remove remaining stray Bintray dependencies


    Unit tests still pass, and ran App on both platforms with no issues.

    Reviewer Tips:
    * Use "Nitpick:" if it's a minor non-crucial request.
    * If you're done with comments either end with a review or comment something helpful like "done with comments for now"
    opened by russhwolf 7
  • KaMPKitDB is not accessible from common or Android module

    KaMPKitDB is not accessible from common or Android module

    Project is building and running fine (tested on Android), however, IDE (Android Studio 4.1) is having issues with resolving imports from db package from common and Android code, and as a result, IDE is underlining all the time those files and doesn't autocomple when typing their names. Invalidating cache/restart doesn't solve this issue. image image image

    opened by tajchert 7
  • the dreaded NDK version is UNKNOWN

    the dreaded NDK version is UNKNOWN


    Apologies if this is too generic and/or ignorant, but both my clones in the latest OSX and Windows Android Studio would fail at syncing with the

    NDK Resolution Outcome: Project settings: Gradle model version=5.6.2, NDK version is UNKNOWN

    This failure persisted after setting the NDK path under Project Structure, in Windows there is a "Download" button to get the NDK, in MacOS I pointed to a manually unpacked NDK.

    The "sync" and eventually the build completed successfully after closing the projects on both platforms and clicking Import Project, which revealed that the UKNOWN message is still in the log, but somehow not the showstopper that it was before the import, no clue what is happening there. I am also confused why Android Studio does not automagically fetch and configure an NDK when required in a project, is it possible that KaMPKit is using an antipattern here, or hitting a Google bug (I saw there is an open issue in Google's Issue Tracker)?


    opened by trurebel 6
  • Kotlin code not highlighted nor debuggable in XCode

    Kotlin code not highlighted nor debuggable in XCode

    I followed the instructions to open KaMPKitiOS in XCode 12. However, the Kotlin code isn't highlighted, nor can I put breakpoints in it. See screenshot: Screen Shot 2021-04-19 at 3 26 03 PM

    opened by IgorGanapolsky 6
  • Slow build and failed tests

    Slow build and failed tests

    I am trying to have 1st build of KaMPKit. I was able to successfully build and run it in Android Studio.

    Now I am trying to run 1st optional step of iOS build. I have already downloaded and run XCode 11.5.

    For unknown reasons the build takes too long and all tests are failing.

    Just in case I am running the build on MacBook Pro 16" (2019), MacOS Catalina 10.15.4.

    $ ./gradlew clean build
    > Task :shared:testReleaseUnitTest
    > Task :shared:testReleaseUnitTest
    co.touchlab.kampkit.KoinTest > checkAllModules FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.ConcurrencyTest > testMain FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.BreedModelTest > updateFavoriteTest FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.BreedModelTest > notifyErrorOnException FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.BreedModelTest > staleDataCheckTest FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.SqlDelightTest > Select All Items Success FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.SqlDelightTest > Update Favorite Success FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.SqlDelightTest > Select Item by Id Success FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    co.touchlab.kampkit.SqlDelightTest > Delete All Success FAILED
            Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException
    9 tests completed, 9 failed
    > Task :shared:testReleaseUnitTest FAILED
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':shared:testReleaseUnitTest'.
    > There were failing tests. See the report at: file:///Users/otrotsenko/dev/repos/3rd_party/kmp/KaMPKit/shared/build/reports/tests/testReleaseUnitTest/index.html
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    * Get more help at https://help.gradle.org
    BUILD FAILED in 47m 53s

    And then in the index.html for each test I see the same:

    Unable to resolve artifact: Missing:
    1) org.robolectric:android-all:jar:4.1.2_r1-robolectric-r1
      Try downloading the file manually from the project website.
      Then, install it using the command: 
          mvn install:install-file -DgroupId=org.robolectric -DartifactId=android-all -Dversion=4.1.2_r1-robolectric-r1 -Dpackaging=jar -Dfile=/path/to/file
      Alternatively, if you host your own repository you can deploy the file there: 
          mvn deploy:deploy-file -DgroupId=org.robolectric -DartifactId=android-all -Dversion=4.1.2_r1-robolectric-r1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
      Path to dependency: 
      	1) org.apache.maven:super-pom:pom:2.0
      	2) org.robolectric:android-all:jar:4.1.2_r1-robolectric-r1
    1 required artifact is missing.
    for artifact: 
    from the specified remote repositories:
      adeya.central (https://nexus.adeya.ch/content/repositories/adeya.central/)
    	at org.apache.maven.artifact.ant.DependenciesTask.doExecuteResolution(DependenciesTask.java:268)
    opened by AlexTrotsenko 5
  • jdk7?


    is there a reason why you use jdk7 instead of jdk8 ?

    from your build.gradle.kts:


    opened by dbaroncelli 5
  • [ios] Allow injection into Koin from iOS

    [ios] Allow injection into Koin from iOS

    This updates the project to allow injection directly from iOS similar to how Android can as seen in: MainApp.kt. Fixes #113

    NOTES: These changes introduce a library to allow us to have a shared object while still being able to mutate it. I think it's not the most ideal setup but it's a good tradeoff for the clean interface to the developer and seeing that this will only be set once. However, I'm open to other suggestions.

    opened by dcvz 4
  • Update to Kotlin 1.3.70

    Update to Kotlin 1.3.70

    Blocked until libraries release versions compatible with 1.3.70

    • [x] Ktor
    • [x] Serialization
    • [x] Coroutines (multithreaded branch)
    • [x] SqlDelight
    • [x] Settings
    • [x] Stately
    • [x] Koin (multithread-safe fork)
    opened by russhwolf 4
  • Add SwiftUI and some compose refactors

    Add SwiftUI and some compose refactors

    Issue: https://github.com/touchlab/KaMPKit/issues/[issue number]


    • [x] iOS
    • [ ] Android
    • [x] KMP




    Reviewer Tips:
    * Use "Nitpick:" if it's a minor non-crucial request.
    * If you're done with comments either end with a review or comment something helpful like "done with comments for now"
    opened by russhwolf 0
  • No dSYM file created when build main branch

    No dSYM file created when build main branch

    As shown in the title, No dSYM file generated after building an iOS app, Need we add configs like this?

    targets.withType<KotlinNativeTarget> {
        binaries.all {
          freeCompilerArgs += "-Xadd-light-debug=enable"


    opened by wuseal 1
  • cocoapodsext fatal error: module 'PromisesSwift' not found

    cocoapodsext fatal error: module 'PromisesSwift' not found

    Hi, I'm trying to add this pod to my project using the following code:

    cocoapodsext {
            summary = "Common library for the KaMP starter kit"
            homepage = "https://github.com/touchlab/KaMPKit"
            framework {
                isStatic = false
                transitiveExport = true

    and I'm getting the following error:

    > Task :shared:cinteropPromisesSwiftIos FAILED
    Exception in thread "main" java.lang.Error: /var/folders/y7/yrztdhk977d4nh8t12ks9bkc0000gn/T/1754490655123836472.m:1:9: fatal error: module 'PromisesSwift' not found
    	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
    	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
    	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:506)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:264)
    	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:74)
    	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
    	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:41)
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':shared:cinteropPromisesSwiftIos'.

    I've tried adding version, and then also module name, but nothing changed. I also get the same error adding frameworks like Alamofire or AFNetworking, I would say that I'm not able to add any pod at all. What am I doing wrong?

    opened by maxdelia 0
  • Refactor BreedModel and tests

    Refactor BreedModel and tests

    Things I'd like to change:

    1. Currently BreedModel assumes callers will sequentially call refreshBreedsIfStale() and getBreedsFromCache(). We should have a single function that coordinates things internally so callers (both platform viewmodels and tests) don't have to.
    2. Currently, getBreedsFromNetwork() returns a DataState, but this is actually only called internally inside refreshBreedsIfStale() which creates its own DataState. This gets a bit awkward because we need a when statement to convert the network call to the final state in refreshBreedsIfStale(), but not all cases of the when actually happen in practice (eg the loading state never triggers). We should wait to convert to a DataState until the last-mile function that gets called externally
    3. getBreedsFromCache() will never emit if the database is empty. If we always refresh before calling it then this won't be a problem, but callers need to know this.
    4. The naming and semantics of the test cases in BreedModelTest are inaccurate and confusing. staleDataCheckTest() asserts on errors that probably shouldn't be happening, and notifyErrorOnException() doesn't assert on any errors even though it expects them to happen
    5. KtorApiMock is currently a separate implementation of KtorApi. We could test our network/serialization logic more directly if it used DogApiImpl but passed a MockEngine to the httpClient.
    6. Should KtorApi be renamed DogApi?
    opened by russhwolf 1
  • Review / Close old branches

    Review / Close old branches

    Create fork of KaMPKit and put it in touchlab-lab org

    touchlab task 
    opened by brady-aiello 0
  • Move CI from Azure to Github Actions

    Move CI from Azure to Github Actions

    Github Actions can replace our CI, and we don't have a good reason for keeping our CI in Azure if we can easily migrate it to the same place code is going.

    touchlab task 
    opened by brady-aiello 0
  • Koin modules inside iOS code

    Koin modules inside iOS code

    You provided an example of how to fetch and use objects from a shared module using koin. But could you also provide an example of how to create koin modules directly inside iOS code on Swift and then fetch these dependenceis?

    Thanks in advance

    opened by BulatMukhutdinov 2
  • Add UI for Loading and Empty DataStates for Android and iOS

    Add UI for Loading and Empty DataStates for Android and iOS

    DataState is defined with 4 subclasses:

    • Error
    • Loading
    • Success
    • Empty

    But we are only changing the UI for 2 states: Success and Error in iOS and Android

    Loading should show a Swipe-refresh style spinner Empty (different issue) should just a TextView saying that there weren't any breeds, and perhaps to try again later.

    opened by brady-aiello 0
  • Rename

    Rename "master" branch to "main"

    Aiming for more inclusive language, and following new policy from GitHub and others. If we wait till January, it'll be easier to rename all PR's to the new branch. In addition to the listed challenges, our CI pipeline will also need to be adjusted.

    From https://github.com/github/renaming:

    Creating a seamless move for existing repositories 🚀

    For existing repositories, renaming the default branch today causes a set of challenges:

    • Open pull requests need to be retargeted to the new branch
    • Draft releases need to be retargeted to the new branch
    • Branch protection policies need to be transferred to the new branch

    Beginning in January 2021, we'll begin rolling out functionality to make it easier to rename the default branch of an existing repository:

    Rename default branch dialog

    Open pull requests and draft releases will be automatically retargeted, branch protection rules will be moved, and to help contributors, prompts will guide them on how to update their local configurations:

    Prompt to update local Git configuration

    touchlab task 
    opened by brady-aiello 2
Gradle plugin for simplify Kotlin Multiplatform mobile configurations

Mobile Multiplatform gradle plugin This is a Gradle plugin for simple setup of Kotlin Multiplatform mobile Gradle modules. Setup buildSrc/build.gradle

IceRock Development 59 Jul 5, 2021
Kotlin Multiplatform Mobile App Template

KMMT : Kotlin Multiplatform Mobile Template Kotlin Multiplatform Mobile Development Simplified KMMT is a KMM based project template designed to simpli

Jitty Andiyan 117 Jul 19, 2021
Kotlin Native Xcode Plugin

Kotlin Native Xcode Support Plugin to facilitate debugging iOS applications using Kotlin Native in Xcode. Defines Kotlin files as source code, with ba

Touchlab 521 Jul 26, 2021
Sync Kotlin files with an Xcode project

Kotlin Xcode Sync Note Soon to be deprecated. You can add folder references instead. See here. Import kotlin files into an Xcode project. This is used

null 24 May 1, 2021
Dependency Injection library for Kotlin Multiplatform, support iOS and Android

Multiplatform-DI library for Kotlin Multiplatform Lightweight dependency injection framework for Kotlin Multiplatform application Dependency injection

Anna Zharkova 12 Jul 27, 2021
BuildConfig for Kotlin Multiplatform Project

BuildKonfig BuildConfig for Kotlin Multiplatform Project. It currently supports embedding values from gradle file. Table Of Contents Motivation Usage

Yasuhiro SHIMIZU 187 Jul 28, 2021
Mobile client for official Nextcloud News App written as Kotlin Multiplatform Project

Newsout Android and iOS mobile client for Nextcloud news App. The Android client is already available to download in the Play Store. F-Droid and Apple

Simon Schubert 117 Apr 16, 2021
Koi, a lightweight kotlin library for Android Development.

Koi - A lightweight Kotlin library for Android Koi include many useful extensions and functions, they can help reducing the boilerplate code in Androi

Hello World 507 Jul 11, 2021
Generic AST parsing library for kotlin multiplatform

kotlinx.ast kotlinx.ast is a generic AST (Abstract Syntax Tree) parsing library, Kotlin is currently the only supported language. The library is desig

null 140 Jul 27, 2021
DI can be simple. Forget about modules and components. Just use it!

PopKorn - Kotlin Multiplatform DI PopKorn is a simple, powerful and lightweight Kotlin Multiplatform Dependency Injector. It doesn't need any modules

Pau Corbella 109 May 22, 2021
Kotlin Multiplatform project that gets network data from Food2Fork.ca

Food2Fork Recipe App This is the codebase for a Kotlin Multiplatform Mobile course. [Watch the course](https://codingwithmitch.com/courses/kotlin-mult

Mitch Tabian 181 Jul 24, 2021
A collection of hand-crafted extensions for your Kotlin projects.

Splitties Splitties is a collection of small Kotlin multiplatform libraries (with Android as first target). These libraries are intended to reduce the

Louis CAD 1.8k Aug 4, 2021
A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android

Blue-Falcon A Bluetooth "Cross Platform" Kotlin Multiplatform library for iOS, Android, MacOS, Raspberry Pi and Javascript. Bluetooth in general has t

Andrew Reed 146 Jul 24, 2021
Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Codename One - Cross Platform Native Apps with Java or Kotlin Codename One is a mobile first cross platform environment for Java and Kotlin developers

Codename One 1k Aug 5, 2021