> ## Documentation Index
> Fetch the complete documentation index at: https://guide.daro.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Migration Guide

> Migrate from the legacy Android SDK (before 2.0.0) to the DARO 2.0.1 SDK.

**Update from 1.x.x → 2.0.1**

* Update the dashboard and app configuration before changing SDK dependencies and code.
* See the [DARO 2.0 SDK migration guide](/en/new-daro-sdk/migration-guide) for the overall sequence and [legacy SDK (before 2.0.0) support](/en/new-daro-sdk/legacy-support) for the support policy.

<Warning>
  Existing Ad Unit IDs continue to work with the DARO 2.0.1 SDK and do not need to be reissued or replaced. For new integrations or when copying a value, use the Ad Unit Key from the updated dashboard. Keep existing Ad Unit IDs in app versions that use the legacy SDK (before 2.0.0); newly created Ad Unit keys do not work with that SDK.
</Warning>

## 1. Update the dashboard

* In the DARO dashboard, select the app you are migrating and complete the update.
* Find its **Integration Key** and Ad Unit Keys.

## 2. Remove legacy key files and settings

* Delete `daro-key.txt` and `android-daro-key.txt` from the project.
* Remove legacy `daroAppKey` settings from `gradle.properties` and build scripts.
* Remove legacy `DARO_APP_KEY` metadata and manual app key settings declared directly by your app.

## 3. Configure DARO integration tools

* Configure the repositories and DARO plugin as described in [Configure your app](/en/sdk-integration-v2/android/get-started#configure-your-app).
* Replace the app module's legacy `so.daro.a` or `so.daro.m` plugin id with `so.daro`, and raise the `so.daro:daro-plugin` classpath in your root `build.gradle` to the version that page lists.

```kotlin theme={null}
plugins {
    id("com.android.application")
    id("so.daro")
}
```

## 4. Configure the Integration Key and app settings

* Copy the Integration Key from the dashboard into `<application>` in the app module's `src/main/AndroidManifest.xml`.

```xml theme={null}
<meta-data
    android:name="DARO_INTEGRATION_KEY"
    android:value="YOUR_INTEGRATION_KEY" />
```

* When setting `DARO_INTEGRATION_KEY` in the manifest, enter the actual key value instead of a `${...}` placeholder.

## 5. Update app-ads.txt

* Follow the [app-ads.txt guide](/en/app-ads-txt-settings) and publish the latest content provided by the dashboard.
* Confirm that the file is accessible on the website registered in the dashboard.

## 6. Update SDK dependencies and code

* Add the `so.daro:daro-sdk` dependency from [Get started](/en/sdk-integration-v2/android/get-started).
* Remove your existing `so.daro:daro-a` (Non-Reward) or `so.daro:daro-m` (Reward) dependency. DARO 2.0.1 SDK merges both artifacts into `so.daro:daro-sdk`.
* Do not include the legacy SDK (before 2.0.0) and DARO 2.0.1 SDK together.

### Initialization and imports

* Use `droom.daro.sdk.Daro` as the initialization import.
* Use `droom.daro.SDKConfig` for initialization settings.

```kotlin theme={null}
import android.app.Application
import droom.daro.SDKConfig
import droom.daro.sdk.Daro

class AppApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        Daro.init(
            application = this,
            sdkConfig = SDKConfig.Builder()
                .setDebugMode(false)
                .setAppMuted(false)
                .build()
        )
    }
}
```

* Initialize the SDK before requesting ads.
* If your app uses child-directed settings, call `setCoppa` before initialization as described in [Privacy settings](/en/sdk-integration-v2/android/control-privacy).

### Check each ad format

* Remove the `placement` argument from Ad Unit constructors.
* Set the dashboard Ad Unit Key through `key`.
* Review loading, display, and cleanup in the format guides below.

| Ad format | What to check |
| - | - |
| [Banner / MREC](/en/sdk-integration-v2/android/ad-formats/banner) | Use `DaroBannerAdUnit(key, bannerSize)`. Keep `resume`, `pause`, and `destroy` calls if you manage the lifecycle manually. |
| [Native](/en/sdk-integration-v2/android/ad-formats/native) | Check `DaroNativeAdUnit(key)` and the binder configuration. |
| [Interstitial](/en/sdk-integration-v2/android/ad-formats/interstitial) | Show after loading succeeds and call `destroy()` when finished. |
| [Rewarded](/en/sdk-integration-v2/android/ad-formats/rewarded) | Use `DaroRewardedAdUnit` and grant rewards in `onEarnedReward`. |
| [App open](/en/sdk-integration-v2/android/ad-formats/appopen) | Use `droom.daro.core.appopen.DaroAppOpenAdManager` and pass an Activity to `showIfAvailable(activity)`. |
| [Light popup](/en/sdk-integration-v2/android/ad-formats/lightpopup) | Show after loading succeeds and call `destroy()` when finished. |

* If you used `so.daro:daro-compose-util`, remove that dependency. Compose support is now included in `daro-sdk`.
* You can keep your existing imports, such as `droom.daro.compose.DaroBanner` and `droom.daro.compose.DaroNative`.
* Apps using Compose need Compose runtime 1.7.0 or later.
* Handle load failures with `onAdLoadFail(error: DaroError)` and `error.errorMessage`.
* See [Error handling](/en/sdk-integration-v2/android/error-handling).

## Verify before release

* Verify initialization and the loading, display, and cleanup of every ad format your app uses.
* Also verify reward callbacks and server callbacks if enabled.
* Keep existing Ad Unit IDs for released app versions that still use the legacy SDK (before 2.0.0).
