Docs Menu
Docs Home
/ /
Atlas Device SDKs

Install the Kotlin SDK

On this page

  • Prerequisites
  • Installation
  • Add the SDK to the Project
  • Sync Gradle Files
  • Supported Target Environments
  • Supported Environments
  • Unsupported Environments

The Atlas Device SDK for Kotlin supports the following platforms. Each has its own installation method and requirements:

  • Android

  • Kotlin Multiplatform (KMP)

Before getting started, ensure your development environment meets the following prerequisites:

For a list of supported target environments, refer to the Supported Target Environments section on this page.

Additionally, Kotlin Multiplatform (KMP) for mobile projects require the following:

For more details on setting up your KMP environment, refer to the official Kotlin Kotlin Multiplatform for mobile documentation. To verify your environment setup, follow Kotlin's guide to checking your environment.

Tip

Kotlin Plugin Version

The Kotlin Multiplatform (KMP) ecosystem frequently changes. If you experience any issues installing the SDK, check your Kotlin Plugin version, since outdated plugins can lead to difficult to debug errors. To see which versions of the Kotlin Plugin are compatible with the SDK, refer to the SDK changelog.

Tip

Atlas Device SDK and Realm

The SDK uses Realm Core database for device data persistence. When you install the Kotlin SDK, the package names reflect Realm naming.

1

Add io.realm.kotlin, specifying the library version and apply false, to the list of plugins in your project-level Gradle build file, typically found at <project>/build.gradle:

Global build.gradle
plugins {
id 'io.realm.kotlin' version '1.16.0' apply false
}

Add the following to your app-level Gradle build file, typically found at <project>/app/build.gradle:

  • Add io.realm.kotlin to the list of plugins.

  • Add the following to the list of dependencies:

    • Add io.realm.kotlin:library-base to the dependencies block.

    • If using Device Sync in your application, add io.realm.kotlin:library-sync to the dependencies block.

  • To use coroutines with the SDK, add org.jetbrains.kotlinx:kotlinx-coroutines-core to the list of dependencies.

Module build.gradle
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'io.realm.kotlin'
}
android {
// ... build configuration settings
}
dependencies {
implementation 'io.realm.kotlin:library-base:1.16.0'
// If using Device Sync
implementation 'io.realm.kotlin:library-sync:1.16.0'
// If using coroutines with the SDK
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0'
}
  1. Add the following to your app-level Gradle build file, typically found at <project>/app/build.gradle:

    • Add io.realm.kotlin to the list of plugins.

    • Add the following to the list of dependencies:

      • Add io.realm.kotlin:library-base to the dependencies block.

      • If using Device Sync in your application, add io.realm.kotlin:library-sync to the dependencies block.

    • To use coroutines with the SDK, add org.jetbrains.kotlinx:kotlinx-coroutines-core to the list of dependencies.

    App build.gradle
    plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
    id("com.android.library")
    id("io.realm.kotlin") version "1.16.0"
    }
    version = "1.0"
    kotlin {
    android()
    iosX64()
    iosArm64()
    sourceSets {
    val commonMain by getting {
    dependencies {
    implementation("io.realm.kotlin:library-base:1.16.0")
    // If using Device Sync
    implementation("io.realm.kotlin:library-sync:1.16.0")
    // If using coroutines with the SDK
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0")
    }
    }
    }
    }
  2. If you use any part of the SDK inside the Android module, add the following compile-time dependencies to your module-level Gradle build file, typically found at <project>/module/build.gradle:

    Android Module build.gradle
    dependencies {
    compileOnly("io.realm.kotlin:library-base:1.16.0")
    }
    // If using Device Sync
    dependencies {
    compileOnly("io.realm.kotlin:library-sync:1.16.0")
    }
2

After updating the Gradle configuration, resolve the dependencies by clicking File > Sync Project with Gradle Files in the Android Studio menu bar. You can now use the Kotlin SDK in your application.

Kotlin Multiplatform (KMP) supports a wide range of application environments Refer also to Kotlin's Multiplatform Gradle DSL reference: Targets documentation.

The Kotlin SDK supports the following environments:

  • android

  • iosArm64

  • iosSimulatorArm64

  • iosX64

  • jvm

  • macosArm64

  • macosX64

The Kotlin SDK does not support the following environments:

  • androidNativeArm32

  • androidNativeArm64

  • androidNativeX86

  • androidNativeX64

  • iosArm32

  • js

  • linuxArm32Hfp

  • linuxArm64

  • linuxMips32

  • linuxMipsel32

  • linuxX64

  • mingwX64

  • mingwX86

  • tvosArm64

  • tvosSimulatorArm64

  • tvosX64

  • wasm32

  • watchosArm32

  • watchosArm64

  • watchosSimulatorArm64

  • watchosX86

  • watchosX64

Next

Welcome to the Atlas Device SDK Docs