# SettingsExtension

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


```
interface SettingsExtension
```

<br />

*** ** * ** ***

Interface used for the `android` DSL in the `settings.gradle[.kts]` file, after the `com.android.settings` plugin is applied.

This allows settings default values that are then applied to all android projects which this build.

## 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/SettingsExtension#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 available options. |
| `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/SettingsExtension#compileSdkAddon(kotlin.String,kotlin.String,kotlin.Int)(vendor: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, version: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)` Specifies an SDK add-on to compile your project against. |
| `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/SettingsExtension#execution(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Execution.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Set execution profiles and options for tools. |
| `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/SettingsExtension#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)` Set Lint options. |
| `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/SettingsExtension#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://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdk(kotlin.Function1)(action: https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/TargetSdkSpec.() -> https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)` Configures all aspects regarding target sdk, see `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/TargetSdkSpec` for available options. |

| ### Public properties |
|---|---|
| `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/SettingsExtension#addOnName()` Value set via `compileSdkAddon` |
| `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/SettingsExtension#addOnVendor()` Value set via `compileSdkAddon` |
| `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/SettingsExtension#addOnVersion()` Value set via `compileSdkAddon` |
| `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/SettingsExtension#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/SettingsExtension#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/SettingsExtension#compileSdkExtension()` Specifies the SDK Extension level to compile your project against. |
| `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/SettingsExtension#compileSdkPreview()` Specify a preview API to compile your project against. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/Execution` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#execution()` Set execution profiles and options for tools. |
| `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/SettingsExtension#lint()` Set Lint options. |
| `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/SettingsExtension#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/SettingsExtension#minSdkPreview()` The minimum SDK version for preview APIs. |
| `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/SettingsExtension#ndkPath()` Requires the specified path to NDK be used. |
| `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/SettingsExtension#ndkVersion()` Requires the specified NDK version to be used. |
| `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/SettingsExtension#targetSdk()` The target 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/SettingsExtension#targetSdkPreview()` The target SDK version. |

## Public functions

### compileSdk

Added in 9.6.0-alpha03

```
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 available options.

### compileSdkAddon

Added in 7.4.0

```
fun compileSdkAddon(vendor: String, name: String, version: Int): Unit
```

Specifies an SDK add-on to compile your project against.

| Parameters |
|---|---|
| `vendor: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The vendor of the add-on. |
| `name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | The name of the add-on. |
| `version: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | The version of the add-on. |

### execution

Added in 7.4.0

```
fun execution(action: Execution.() -> Unit): Unit
```

Set execution profiles and options for tools.

### lint

Added in 9.6.0-alpha03

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

Set Lint options.

### minSdk

Added in 9.6.0-alpha03

```
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.

### targetSdk

Added in 9.6.0-alpha03

```
fun targetSdk(action: TargetSdkSpec.() -> Unit): Unit
```

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

## Public properties

### addOnName

Added in 7.4.0

```
val addOnName: String?
```

Value set via `compileSdkAddon`

### addOnVendor

Added in 7.4.0

```
val addOnVendor: String?
```

Value set via `compileSdkAddon`

### addOnVersion

Added in 7.4.0

```
val addOnVersion: Int?
```

Value set via `compileSdkAddon`

### buildToolsVersion

Added in 7.4.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.

See `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/CommonExtension#buildToolsVersion(kotlin.String)` for more information

### compileSdk

Added in 7.4.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 7.4.0

```
var compileSdkExtension: Int?
```

Specifies the SDK Extension level to compile your project against. This value is optional.

When not provided the base extension for the given `compileSdk` API level will be selected.

### compileSdkPreview

Added in 7.4.0

```
var compileSdkPreview: String?
```

Specify a preview API to compile your project against.

For example, to try out the Android S preview, rather than `compileSdk = 30` you can use `compileSdkPreview = "S"`

Once the preview APIs are finalized, they will be allocated a stable integer value.

### execution

Added in 7.4.0

```
val execution: Execution
```

Set execution profiles and options for tools.

### lint

Added in 9.6.0-alpha03

```
val lint: Lint
```

Set Lint options.

### minSdk

Added in 7.4.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/SettingsExtension#minSdk()` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#minSdkPreview()` setters. Only one of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#minSdk()` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#minSdkPreview()` should be set.

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

### minSdkPreview

Added in 7.4.0

```
var minSdkPreview: String?
```

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

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

### ndkPath

Added in 7.4.0

```
var ndkPath: String?
```

Requires the specified path to NDK be used.

See `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/CommonExtension#ndkPath()` for more information

### ndkVersion

Added in 7.4.0

```
var ndkVersion: String
```

Requires the specified NDK version to be used.

See `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/CommonExtension#ndkVersion()` for more information

### targetSdk

Added in 8.8.0

```
var targetSdk: Int?
```

The target 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/SettingsExtension#targetSdk()` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdkPreview()` setters. Only one of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdk()` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdkPreview()` should be set.

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

### targetSdkPreview

Added in 8.8.0

```
var targetSdkPreview: String?
```

The target 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/SettingsExtension#targetSdk(kotlin.Function1)` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdkPreview()` setters. Only one of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdk(kotlin.Function1)` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/SettingsExtension#targetSdkPreview()` should be set.

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