Create a multiplatform library

This section provides steps for creating a multiplatform library. You can also complete the tutorial where you will create a multiplatform library, test it, and publish it to Maven.

  1. In IntelliJ IDEA, select File | New | Project.

  2. In the panel on the left, select Kotlin.

  3. Enter a project name, then in the Multiplatform section select Library as the project template.

    Select a project template
  4. Select the Gradle DSL – Kotlin or Groovy.

  5. Click Next.

You can finish creating the project by clicking Finish on the next screen or configure it if necessary:

  1. Add the target platforms and modules by clicking the + icon.

  2. Configure target settings, such as the target template, JVM target version, and test framework.

    Configure the project
  3. If necessary, specify dependencies between modules:

    • Multiplatform and Android modules

    • Multiplatform and iOS modules

    • JVM modules

    Add module dependencies
  4. Click Finish.

The new project opens.

What's next?

Last modified: 13 September 2021

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/docs/mpp-create-lib.html