# SettingsExtension

# 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.1  

<br />

```
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                             |
|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [compileSdkAddon](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#compileSdkAddon(kotlin.String,kotlin.String,kotlin.Int))`(vendor: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, name: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, version: `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [execution](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#execution(kotlin.Function1))`(action: `[Execution](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/Execution)`.() `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Set execution profiles and options for tools.                                                  |

|                                             ### Public properties                                             |
|---------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                           | [addOnName](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#addOnName()) Value set via`compileSdkAddon`                                                                                                                                  |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                           | [addOnVendor](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#addOnVendor()) Value set via`compileSdkAddon`                                                                                                                              |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                 | [addOnVersion](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#addOnVersion()) Value set via`compileSdkAddon`                                                                                                                            |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                              | [buildToolsVersion](https://developer.android.com/reference/tools/gradle-api/8.5/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. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                 | [compileSdk](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#compileSdk()) Specifies the API level to compile your project against.                                                                                                      |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                 | [compileSdkExtension](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#compileSdkExtension()) Specifies the SDK Extension level to compile your project against.                                                                          |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                           | [compileSdkPreview](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#compileSdkPreview()) Specify a preview API to compile your project against.                                                                                          |
| [Execution](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/Execution) | [execution](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#execution()) Set execution profiles and options for tools.                                                                                                                   |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?`                                 | [minSdk](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#minSdk()) The minimum SDK version.                                                                                                                                              |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                           | [minSdkPreview](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#minSdkPreview())                                                                                                                                                         |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                           | [ndkPath](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#ndkPath()) Requires the specified path to NDK be used.                                                                                                                         |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                              | [ndkVersion](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#ndkVersion()) Requires the specified NDK version to be used.                                                                                                                |

## Public functions

### compileSdkAddon

Added in 7.4.1  

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

### execution

Added in 7.4.1  

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

Set execution profiles and options for tools.  

## Public properties

### addOnName

Added in 7.4.1  

```
val addOnName: String?
```

Value set via`compileSdkAddon`  

### addOnVendor

Added in 7.4.1  

```
val addOnVendor: String?
```

Value set via`compileSdkAddon`  

### addOnVersion

Added in 7.4.1  

```
val addOnVersion: Int?
```

Value set via`compileSdkAddon`  

### buildToolsVersion

Added in 7.4.1  

```
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[com.android.build.api.dsl.CommonExtension.buildToolsVersion](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/CommonExtension#buildToolsVersion(kotlin.String))for more information  

### compileSdk

Added in 7.4.1  

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

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

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

```
val execution: Execution
```

Set execution profiles and options for tools.  

### minSdk

Added in 7.4.1  

```
var minSdk: Int?
```

The minimum SDK version. Setting this it will override previous calls of[minSdk](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#minSdk())and[minSdkPreview](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#minSdkPreview())setters. Only one of[minSdk](https://developer.android.com/reference/tools/gradle-api/8.5/com/android/build/api/dsl/SettingsExtension#minSdk())and[minSdkPreview](https://developer.android.com/reference/tools/gradle-api/8.5/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.1  

```
var minSdkPreview: String?
```  

### ndkPath

Added in 7.4.1  

```
var ndkPath: String?
```

Requires the specified path to NDK be used.

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

### ndkVersion

Added in 7.4.1  

```
var ndkVersion: String
```

Requires the specified NDK version to be used.

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