Skip to main content
Version: 2.1.x

Integrate Appxiom in Kotlin Multiplatform

The Appxiom KMP SDK provides cross-platform telemetry, real-time crash reporting, coroutine error trapping, UI breadcrumbs, and business goal tracking across Android and iOS.

Prefer AI Coding Agents? Automate this setup with Appxiom KMP Skills (npx @appxiom/kmp-skills add all).


Step 1: Update Gradle​

Add the following to your root settings.gradle.kts:

pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven {
url = uri("https://appxiom-kmp.s3.us-west-1.amazonaws.com")
}
}
}

dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven {
url = uri("https://appxiom-kmp.s3.us-west-1.amazonaws.com")
}
maven {
url = uri("https://appxiom-android.s3.us-west-1.amazonaws.com")
}
}
}

If your project manages repositories via allprojects in the root build.gradle.kts:

allprojects {
repositories {
google()
mavenCentral()
maven {
url = uri("https://appxiom-kmp.s3.us-west-1.amazonaws.com")
}
maven {
url = uri("https://appxiom-android.s3.us-west-1.amazonaws.com")
}
}
}

Step 2: Apply Plugin & Add Dependencies​

In your shared module's build.gradle.kts (e.g. composeApp/build.gradle.kts or shared/build.gradle.kts):

val appxiomVersion = "2.1.0" // Replace with the latest resolved version

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.android.application)
// Appxiom KMP Gradle Plugin:
id("tech.appxiom.kmp") version "2.1.0"
}

kotlin {
// 1. Configure iOS framework targets with core export
listOf(
iosArm64(),
iosSimulatorArm64(),
iosX64()
).forEach { iosTarget ->
iosTarget.binaries.framework {
baseName = "ComposeApp" // Or your shared framework name
isStatic = true

// REQUIRED when initializing Ax from Swift (Ax.shared.startIOS()):
export("tech.appxiom:appxiom-kmp-core:$appxiomVersion")
}
}

sourceSets {
commonMain.dependencies {
// Core SDK: Must be `api`
api("tech.appxiom:appxiom-kmp-core:$appxiomVersion")

// Optional: Compose Multiplatform UI & Screen Tracking
// (ALWAYS `implementation`, NEVER `export` to iOS framework)
implementation("tech.appxiom:appxiom-kmp-compose:$appxiomVersion")

// Optional: Ktor Client HTTP Telemetry Plugin
// (ALWAYS `implementation`, NEVER `export` to iOS framework)
implementation("tech.appxiom:appxiom-kmp-ktor:$appxiomVersion")
}
}
}
Do NOT Export Compose or Ktor Modules to iOS Framework Binaries

Keep appxiom-kmp-compose and appxiom-kmp-ktor as implementation(...) and never export them in binaries.framework.


Next Steps​

Now that the dependencies and Gradle plugin are in place, proceed to Platform Initialization to initialize the SDK with your dashboard keys.