# KotlinMultiplatformAndroidLibraryExtension

[View Source](https://cs.android.com/search?q=file:com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension.kt+class:com.android.build.api.dsl.KotlinMultiplatformAndroidLibraryExtension) Added in 8.8.0


```
interface KotlinMultiplatformAndroidLibraryExtension
```

<br />

Known direct subclasses [KotlinMultiplatformAndroidLibraryTarget](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryTarget)

|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryTarget` |   |

*** ** * ** ***

Extension properties for Kotlin multiplatform Android libraries.

Only the Kotlin Multiplatform Android Plugin should create instances of this interface.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#aarMetadata(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/AarMetadata.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Options for configuring AAR metadata. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#androidResources(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/LibraryAndroidResources.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Specifies options for configuring android resources and assets for KMP |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#compileSdk(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/CompileSdkSpec.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Configures all aspects regarding compile Sdk version, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/CompileSdkSpec` for more details. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#lint(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Lint.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Specifies options for the lint tool. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#localDependencySelection(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DependencySelection.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Specifies options for doing variant selection for external Android dependencies based on build types and product flavors |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdk(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/MinSdkSpec.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Configures all aspects regarding minSdk, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/MinSdkSpec` for available options. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `@https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#optimization(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Specifies options for the R8/D8 optimization tool. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#packaging(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Packaging.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Specifies options and rules that determine which files the Android plugin packages into your AAR. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#testCoverage(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/TestCoverage.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#useLibrary(kotlin.String)(name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Includes the specified library to the classpath. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#useLibrary(kotlin.String,kotlin.Boolean)(name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, required: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` Includes the specified library to the classpath. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#withDeviceTest(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Creates and configures a compilation for tests that run on the device (previously referred to as instrumented tests). |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/HasConfigurableValue<https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#withDeviceTestBuilder(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Creates and configures a compilation for tests that run on the device (previously referred to as instrumented tests). |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#withHostTest(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTest.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Creates and configures a compilation for tests that run on the JVM (previously referred to as unit tests). |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/HasConfigurableValue<https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTest>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#withHostTestBuilder(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Creates and configures a compilation for tests that run on the JVM (previously referred to as unit tests). |

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/AarMetadata` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#aarMetadata()` Options for configuring AAR metadata. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/LibraryAndroidResources` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#androidResources()` Specifies options for configuring android resources and assets for KMP |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#buildToolsVersion()` Specifies the version of the [SDK Build Tools](https://developer.android.com/studio/releases/build-tools.html) to use when building your project. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#compileSdk()` Specifies the API level to compile your project against. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#compileSdkExtension()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#compileSdkPreview()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#enableCoreLibraryDesugaring()` Whether core library desugaring is enabled. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-map/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#experimentalProperties()` Additional per module experimental properties. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Lint` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#lint()` Specifies options for the lint tool. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DependencySelection` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#localDependencySelection()` Specifies options for doing variant selection for external Android dependencies based on build types and product flavors |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdk()` The minimum SDK version. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdkPreview()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#namespace()` The namespace of the generated R and BuildConfig classes. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#optimization()` Specifies options for the R8/D8 optimization tool. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Packaging` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#packaging()` Specifies options and rules that determine which files the Android plugin packages into your AAR. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/TestCoverage` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#testCoverage()` Configure the gathering of code-coverage from tests. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html?` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#testNamespace()` The namespace used by the android test and unit test components for the generated R and BuildConfig classes. |

## Public functions

### aarMetadata

Added in 8.8.0

```
fun aarMetadata(action: AarMetadata.() -> Unit): Unit
```

Options for configuring AAR metadata.

### androidResources

Added in 8.11.0

```
fun androidResources(action: LibraryAndroidResources.() -> Unit): Unit
```

Specifies options for configuring android resources and assets for KMP

### compileSdk

Added in 8.13.0

```
fun compileSdk(action: CompileSdkSpec.() -> Unit): Unit
```

Configures all aspects regarding compile Sdk version, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/CompileSdkSpec` for more details.

### lint

Added in 8.8.0

```
fun lint(action: Lint.() -> Unit): Unit
```

Specifies options for the lint tool.

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Lint`.

### localDependencySelection

Added in 8.12.0

```
fun localDependencySelection(action: DependencySelection.() -> Unit): Unit
```

Specifies options for doing variant selection for external Android dependencies based on build types and product flavors

Note that this only affects dependency selection within this gradle project and does not affect the resolution of dependencies in other Gradle projects that depend on this project or the artifacts published from this project

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DependencySelection`.

### minSdk

Added in 8.13.0

```
fun minSdk(action: MinSdkSpec.() -> Unit): Unit
```

Configures all aspects regarding minSdk, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/MinSdkSpec` for available options.

### optimization

Added in 8.8.0

```
@Incubating
fun optimization(action: KmpOptimization.() -> Unit): Unit
```

Specifies options for the R8/D8 optimization tool.

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization`.

### packaging

Added in 8.8.0

```
fun packaging(action: Packaging.() -> Unit): Unit
```

Specifies options and rules that determine which files the Android plugin packages into your AAR.

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Packaging`.

### testCoverage

Added in 9.6.0-alpha03

```
fun testCoverage(action: TestCoverage.() -> Unit): Unit
```

### useLibrary

Added in 8.8.0

```
fun useLibrary(name: String): Unit
```

Includes the specified library to the classpath.

You typically use this property to support optional platform libraries that ship with the Android SDK. The following sample adds the Apache HTTP API library to the project classpath:

```kotlin
android {
    // Adds a platform library that ships with the Android SDK.
    useLibrary 'org.apache.http.legacy'
}
```

To include libraries that do not ship with the SDK, such as local library modules or binaries from remote repositories, [add the libraries as dependencies](https://developer.android.com/studio/build/dependencies.html) in the `dependencies` block. Note that Android plugin 3.0.0 and later introduce [new dependency configurations](https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#new_configurations). To learn more about Gradle dependencies, read [Dependency Management Basics](https://docs.gradle.org/current/userguide/artifact_dependencies_tutorial.html).

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | the name of the library. |

### useLibrary

Added in 8.8.0

```
fun useLibrary(name: String, required: Boolean): Unit
```

Includes the specified library to the classpath.

You typically use this property to support optional platform libraries that ship with the Android SDK. The following sample adds the Apache HTTP API library to the project classpath:

```kotlin
android {
    // Adds a platform library that ships with the Android SDK.
    useLibrary 'org.apache.http.legacy'
}
```

To include libraries that do not ship with the SDK, such as local library modules or binaries from remote repositories, "https://developer.android.com/studio/build/dependencies.html in the `dependencies` block. Note that Android plugin 3.0.0 and later introduce new dependency configurations. To learn more about Gradle dependencies, read [Dependency Management Basics](https://docs.gradle.org/current/userguide/artifact_dependencies_tutorial.html)

| Parameters |
|---|---|
| `name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | the name of the library. |
| `required: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | if using the library requires a manifest entry, the entry will indicate that the library is not required. |

### withDeviceTest

Added in 8.8.0

```
fun withDeviceTest(action: KotlinMultiplatformAndroidDeviceTest.() -> Unit): Unit
```

Creates and configures a compilation for tests that run on the device (previously referred to as instrumented tests). Invoking this method will create a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTestCompilation` object with the following defaults:

- compilation name is "deviceTest"

- default sourceSet name is "androidDeviceTest" (sources would be located at `$project/src/androidDeviceTest`)

- sourceSet tree is `null`, which means that the `commonTest` sourceSet will **not** be included in the compilation.

Only a single compilation of this test type can be created. If you want to configure `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest` options, you can modify it on the kotlin compilation as follows:

```kotlin
kotlin {
  android {
    compilations.withType(com.android.build.api.dsl.KotlinMultiplatformAndroidDeviceTestCompilation::class.java) {
      // configure options
    }
  }
}
```

### withDeviceTestBuilder

Added in 8.8.0

```
fun withDeviceTestBuilder(action: KotlinMultiplatformAndroidCompilationBuilder.() -> Unit): HasConfigurableValue<KotlinMultiplatformAndroidDeviceTest>
```

Creates and configures a compilation for tests that run on the device (previously referred to as instrumented tests). Invoking this method will create a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTestCompilation` object using the values set in the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder`.

The returned object can be used to configure `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest` as follows:

```kotlin
kotlin {
  android {
    withDeviceTestBuilder {
    }.configure {
      instrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }
  }
}
```

Only a single compilation of this test type can be created. If you want to configure `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidDeviceTest` options, you can modify it on the kotlin compilation as follows:

```kotlin
kotlin {
  android {
    compilations.withType(com.android.build.api.dsl.KotlinMultiplatformAndroidDeviceTestCompilation::class.java) {
      // configure options
    }
  }
}
```

### withHostTest

Added in 8.8.0

```
fun withHostTest(action: KotlinMultiplatformAndroidHostTest.() -> Unit): Unit
```

Creates and configures a compilation for tests that run on the JVM (previously referred to as unit tests). Invoking this method will create a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTestCompilation` object with the following defaults (You can change these defaults by using `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#withHostTestBuilder(kotlin.Function1)` instead):

- compilation name is "hostTest"

- default sourceSet name is "androidHostTest" (sources would be located at `$project/src/androidHostTest`)

- sourceSet tree is `test`, which means that the `commonTest` sourceSet would be included in the compilation.

Only a single compilation of this test type can be created. If you want to configure `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTest` options, you can modify it on the kotlin compilation as follows:

```kotlin
kotlin {
  android {
    compilations.withType(com.android.build.api.dsl.KotlinMultiplatformAndroidHostTestCompilation::class.java) {
      // configure options
    }
  }
}
```

### withHostTestBuilder

Added in 8.8.0

```
fun withHostTestBuilder(action: KotlinMultiplatformAndroidCompilationBuilder.() -> Unit): HasConfigurableValue<KotlinMultiplatformAndroidHostTest>
```

Creates and configures a compilation for tests that run on the JVM (previously referred to as unit tests). Invoking this method will create a `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTestCompilation` object using the values set in the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidCompilationBuilder`.

The returned object can be used to configure `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTest` as follows:

```kotlin
kotlin {
  android {
    withHostTestBuilder {
    }.configure {
      isIncludeAndroidResources = true
    }
  }
}
```

Only a single compilation of this test type can be created. If you want to configure `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidHostTest` options, you can modify it on the kotlin compilation as follows:

```kotlin
kotlin {
  android {
    compilations.withType(com.android.build.api.dsl.KotlinMultiplatformAndroidHostTestCompilation::class.java) {
      // configure options
    }
  }
}
```

## Public properties

### aarMetadata

Added in 8.8.0

```
val aarMetadata: AarMetadata
```

Options for configuring AAR metadata.

### androidResources

Added in 8.11.0

```
val androidResources: LibraryAndroidResources
```

Specifies options for configuring android resources and assets for KMP

### buildToolsVersion

Added in 8.8.0

```
var buildToolsVersion: String
```

Specifies the version of the [SDK Build Tools](https://developer.android.com/studio/releases/build-tools.html) to use when building your project.

By default, the plugin uses the minimum version of the build tools required by the [version of the plugin](https://developer.android.com/studio/releases/gradle-plugin.html#revisions) you're using. To specify a different version of the build tools for the plugin to use, specify the version as follows:

```kotlin
android {
    // Specifying this property is optional.
    buildToolsVersion "26.0.0"
}
```

For a list of build tools releases, read [the release notes](https://developer.android.com/studio/releases/build-tools.html#notes).

Note that the value assigned to this property is parsed and stored in a normalized form, so reading it back may give a slightly different result.

### compileSdk

Added in 8.8.0

```
var compileSdk: Int?
```

Specifies the API level to compile your project against. The Android plugin requires you to configure this property.

This means your code can use only the Android APIs included in that API level and lower. You can configure the compile sdk version by adding the following to the `android` block: `compileSdk = 26`.

You should generally [use the most up-to-date API level](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) available. If you are planning to also support older API levels, it's good practice to [use the Lint tool](https://developer.android.com/studio/write/lint.html) to check if you are using APIs that are not available in earlier API levels.

The value you assign to this property is parsed and stored in a normalized form, so reading it back may return a slightly different value.

### compileSdkExtension

Added in 8.8.0

```
var compileSdkExtension: Int?
```

### compileSdkPreview

Added in 8.8.0

```
var compileSdkPreview: String?
```

### enableCoreLibraryDesugaring

Added in 8.8.0

```
var enableCoreLibraryDesugaring: Boolean
```

Whether core library desugaring is enabled.

### experimentalProperties

Added in 8.8.0

```
val experimentalProperties: MutableMap<String, Any>
```

Additional per module experimental properties.

### lint

Added in 8.8.0

```
val lint: Lint
```

Specifies options for the lint tool.

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Lint`.

### localDependencySelection

Added in 8.12.0

```
val localDependencySelection: DependencySelection
```

Specifies options for doing variant selection for external Android dependencies based on build types and product flavors

Note that this only affects dependency selection within this gradle project and does not affect the resolution of dependencies in other Gradle projects that depend on this project or the artifacts published from this project

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/DependencySelection`.

### minSdk

Added in 8.8.0

```
var minSdk: Int?
```

The minimum SDK version. Setting this it will override previous calls of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdk()` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdkPreview()` setters. Only one of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdk()` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KotlinMultiplatformAndroidLibraryExtension#minSdkPreview()` should be set.

See [uses-sdk element documentation](http://developer.android.com/guide/topics/manifest/uses-sdk-element.html).

### minSdkPreview

Added in 8.8.0

```
var minSdkPreview: String?
```

### namespace

Added in 8.8.0

```
var namespace: String?
```

The namespace of the generated R and BuildConfig classes. Also, the namespace used to resolve any relative class names that are declared in the AndroidManifest.xml.

### optimization

Added in 8.8.0

```
val optimization: KmpOptimization
```

Specifies options for the R8/D8 optimization tool.

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/KmpOptimization`.

### packaging

Added in 8.8.0

```
val packaging: Packaging
```

Specifies options and rules that determine which files the Android plugin packages into your AAR.

For more information about the properties you can configure in this block, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Packaging`.

### testCoverage

Added in 8.8.0

```
val testCoverage: TestCoverage
```

Configure the gathering of code-coverage from tests.

### testNamespace

Added in 8.8.0

```
var testNamespace: String?
```

The namespace used by the android test and unit test components for the generated R and BuildConfig classes.