---
title: Get started with the Unified SDK for Android
description: "Install the Amplitude Unified SDK for Android, initialize Analytics, Session Replay, and Feature Experiment from one constructor, and send a first event."
product: analytics
lang: en
last_updated: 2026-11-04
token_estimate: 1916
---
# Get started with the Unified SDK for Android

- **Package:** `com.amplitude:unified-android` ([maven](https://search.maven.org/artifact/com.amplitude/unified-android))
- **Latest version:** 1.1.0

This guide helps you install the Unified SDK for Android (`com.amplitude:unified-android`), initialize every product it includes with one constructor, and send one custom event to Amplitude. For the full option list, go to [UnifiedConfigurationBuilder](https://amplitude.com/docs/sdks/analytics/android/unified-sdk/reference#unifiedconfigurationbuilder). For changes between versions, go to the [Unified SDK changelog](https://github.com/amplitude/Amplitude-Kotlin/blob/main/unified/CHANGELOG.md).

> For AI agents: a documentation index is available at [/docs/llms.txt](/docs/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

The Unified SDK bundles the [Android-Kotlin SDK](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/get-started) (`com.amplitude:analytics-android`) with the [Session Replay Android plugin](https://amplitude.com/docs/sdks/session-replay/session-replay-android-plugin) and the [Experiment Android SDK](https://amplitude.com/docs/sdks/experiment-sdks/experiment-android). `AmplitudeUnified` extends the Android-Kotlin SDK's `Amplitude` class, so every analytics method and option works the same. If you need Analytics only, install the Android-Kotlin SDK instead. Don't add both SDKs, or the separate Session Replay and Experiment SDKs, to the same app.

## Prerequisites

- An Amplitude project and its API key. To find the key, go to _Settings > Projects_, select your project, and open _General_.
- The data center your organization uses: US (default) or EU.
- An app with `minSdk` 21 (Android 5.0) or later, built with `compileSdk` 35 or later.

## Install the SDK

Add the dependency to your module's build file (`build.gradle.kts` or `build.gradle`), then sync the project:

#### Kotlin DSL

```kotlin
dependencies {
    implementation("com.amplitude:unified-android:1.1.0")
}
```

#### Groovy

```groovy
dependencies {
    implementation 'com.amplitude:unified-android:1.1.0'
}
```

The dependency brings in Analytics, Session Replay, and Experiment. If your app already declares any of those SDKs separately, remove them. Gradle resolves each SDK to one version without a warning, and that version can differ from the version the Unified SDK was built with. Version 1.1.0 includes `analytics-android` 1.36.0, `plugin-session-replay-android` 0.31.0, and `experiment-android-client` 1.18.0.

### Fix installation problems

| Symptom | Cause | Fix |
| --- | --- | --- |
| R8 reports missing `org.conscrypt`, `org.bouncycastle`, or `org.openjsse` classes | Experiment 1.18.0 depends on OkHttp 4.9.1, which doesn't ship R8 rules for optional TLS providers. | Add `implementation("com.squareup.okhttp3:okhttp:4.12.0")`. OkHttp 4.12.0 includes those rules. |
| Kotlin reports `Cannot access 'CoroutineScope'` when you call Session Replay members | The Session Replay API exposes a coroutines type that isn't on your compile classpath. | Add `implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")`. |

## Initialize the SDK

Create one `AmplitudeUnified` instance per process, in `Application.onCreate`, and reuse it. Pass the application context. The constructor builds Analytics, then installs Session Replay, then Experiment.

#### Kotlin

```kotlin
import com.amplitude.unified.AmplitudeUnified

val amplitude = AmplitudeUnified("YOUR_API_KEY", applicationContext) {
    analytics {
        // Android-Kotlin SDK options, for example serverZone = ServerZone.EU
    }
    sessionReplay {
        sampleRate = 1.0 // Records every session. Lower this before production.
    }
}
```

#### Java

```java
import com.amplitude.unified.AmplitudeUnified;
import com.amplitude.unified.UnifiedConfigurationBuilder;

UnifiedConfigurationBuilder builder =
    new UnifiedConfigurationBuilder("YOUR_API_KEY", getApplicationContext());
builder.getSessionReplay().setSampleRate(1.0); // Records every session. Lower this before production.

AmplitudeUnified amplitude = builder.build();
```

Session Replay records nothing until you set `sampleRate` above `0.0`. Experiment uses your Analytics API key as its deployment key unless you set `experiment { deploymentKey = "..." }`.

### Fix initialization problems

| Symptom | Cause | Fix |
| --- | --- | --- |
| Log: `Failed to install plugin "<name>": <exception>` | Session Replay or Experiment threw during setup. The SDK skips that product and keeps Analytics and the other product running. | Read the exception in the log. The accessor for the skipped product (`sessionReplay` or `experiment`) returns `null`. |
| `amplitude.experiment` returns `null` with Experiment enabled | The app also adds its own `AmplitudeExperimentPlugin`, so the instance holds more than one Experiment client and the accessor can't pick one. | Remove your own Experiment plugin and any `Experiment.initializeWithAmplitudeAnalytics()` call. Go to [Migrate from separate SDKs](https://amplitude.com/docs/sdks/analytics/android/unified-sdk/instrument-and-configure#migrate-from-separate-sdks). |
| No replays | `sessionReplay.sampleRate` is `0.0`, the default. | Set `sampleRate` above `0.0`. |
| No variants, or variants for the wrong project | Experiment uses the Analytics API key, but your flags belong to a deployment with a different key. | Set `experiment { deploymentKey = "YOUR_DEPLOYMENT_KEY" }`. |

For analytics initialization problems, go to [Fix initialization problems](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/get-started#fix-initialization-problems) in the Android-Kotlin SDK.

## Send a first event

Track one custom event, then flush so you don't wait for the upload interval:

#### Kotlin

```kotlin
amplitude.track("Sign Up Clicked", mapOf("plan" to "starter"))
amplitude.flush()
```

#### Java

```java
Map<String, Object> properties = new HashMap<>();
properties.put("plan", "starter");
amplitude.track("Sign Up Clicked", properties);
amplitude.flush();
```

### Fix upload problems

The Unified SDK uploads events through the bundled Android-Kotlin SDK, so upload behavior and log messages match the Android-Kotlin SDK. Go to [Fix upload problems](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/get-started#fix-upload-problems) in the Android-Kotlin SDK.

## Confirm the event in Amplitude

1. In Amplitude, open **User Lookup** and search for the device ID from `amplitude.getDeviceId()`.
2. Open the **Activity** tab and turn on **Live event updates**.
3. Confirm that `Sign Up Clicked` appears with the `plan` property.

If the event doesn't appear within a minute, follow [Verify events](https://amplitude.com/docs/sdks/analytics/android/unified-sdk/verify-events).

## Next steps

- Set options for each product. Go to [Configure each product](https://amplitude.com/docs/sdks/analytics/android/unified-sdk/instrument-and-configure#configure-each-product).
- Read flag variants. Go to [Use Feature Experiment](https://amplitude.com/docs/sdks/analytics/android/unified-sdk/instrument-and-configure#use-feature-experiment).
- Replace separate Analytics, Session Replay, and Experiment setup. Go to [Migrate from separate SDKs](https://amplitude.com/docs/sdks/analytics/android/unified-sdk/instrument-and-configure#migrate-from-separate-sdks).
- Track custom events, identify users, and choose autocapture events. Go to the [Instrument and configure the Android-Kotlin SDK](https://amplitude.com/docs/sdks/analytics/android/android-kotlin-sdk/instrument-and-configure).

